annotate mm7_3.cpp @ 98:f76e4ea4a224

Outdoor::Load
author Nomad
date Sun, 04 Nov 2012 03:58:34 +0200
parents 6c42178c226e
children 6305c1cd9f6e
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 //----- (0047253E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 void __cdecl UpdateObjects()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 unsigned int v0; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 __int16 v3; // dx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 ObjectDesc *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 int v5; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 __int16 v6; // cx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 signed int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 __int16 v8; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 unsigned int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 signed int v11; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 int v12; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 int v14; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 unsigned int v15; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 unsigned int v16; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 unsigned int v17; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 int v18; // [sp+4h] [bp-10h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 int v19; // [sp+8h] [bp-Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 signed int v20; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2209 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 v2 = (char *)&pLayingItems[0].uSpriteFrameID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 LOWORD(v0) = *((short *)v2 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 if ( v0 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 v0 &= 0xFFFFFFBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 *((short *)v2 - 2) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 v3 = *((short *)v2 - 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 v4 = &pObjectList->pObjects[*((short *)v2 - 14)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 if ( (v0 & 0x80u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 v5 = *(int *)(v2 + 62) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 *(int *)(v2 - 26) = pActors[v5].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 *(int *)(v2 - 22) = pActors[v5].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 if ( !v3 || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 if ( v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 v7 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 v7 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 if ( v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 v8 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 *(short *)v2 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 v9 = v4->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 if ( !(v9 & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 if ( v8 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 LayingItem::_42F933(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 v11 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 v11 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 if ( v8 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 LayingItem::UpdateObject_fn0_BLV(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 LayingItem::UpdateObject_fn0_ODM(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 if ( pParty->bTurnBasedModeOn != 1 || !(*(v2 - 4) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 v12 = abs(pParty->vPosition.x - *(int *)(v2 - 26));
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2268 v18 = abs(pParty->vPosition.y - *(int *)(v2 - 22));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2269 v19 = abs(pParty->vPosition.z - *(int *)(v2 - 18));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 v14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 v15 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 if ( v12 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 v13 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 v14 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 if ( v13 < v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 v16 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 v13 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 if ( v14 < (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 v0 = (unsigned int)(11 * v14) >> 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 if ( (signed int)(v0 + (v15 >> 2) + v13) <= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 v10 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 if ( !(v9 & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 _46BFFA_check_object_intercept(v1, 8 * v1 | OBJECT_Item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 v2 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 v1 = v20++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 while ( v20 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 //----- (0047272C) --------------------------------------------------------
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2312 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
2313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 signed int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 int v7; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 signed int v8; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2319 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 v5 = x - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 v7 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 v8 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2324 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, pFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 *pSectorID = pIndoor->GetSector(v7 + 2, v8, z + 40);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2328 result = _46ED1B_collide_against_floor(v7 + 2, 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, v8 - 2, z + 40);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2332 result = _46ED1B_collide_against_floor(v7, v8 - 2, 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, z + 140);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2340 result = _46ED1B_collide_against_floor(v7, v8, z + 140, pSectorID, pFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 //----- (00472866) --------------------------------------------------------
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2349 void BLV_ProcessPartyActions()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 int v6; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 signed __int64 v8; // qax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 int v9; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 double v10; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 unsigned int v12; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 double v13; // st7@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 int v14; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 signed __int64 v15; // qax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 double v16; // st7@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 int v17; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 double v18; // st7@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 int v19; // ST40_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 int v20; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 double v21; // st7@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 int v22; // ST40_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 int v23; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 double v24; // st7@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 int v25; // ST40_4@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 int v26; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 double v27; // st7@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 int v28; // ST40_4@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 unsigned int v35; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 int v36; // ecx@88
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2376 int new_party_z; // esi@96
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 int v38; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 int v39; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 int v40; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 Player **v41; // esi@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 int v42; // eax@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 signed int v43; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 BLVFace *v44; // esi@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 PolygonType v45; // al@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 int v46; // ecx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 char v47; // zf@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 int v48; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 int v49; // ST40_4@136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 int v50; // ST40_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 int v51; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 int v52; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 signed int v53; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 int v54; // ebx@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 int v55; // ST30_4@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 AudioPlayer *v56; // ecx@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 SoundID v57; // [sp-20h] [bp-80h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 signed int v58; // [sp-1Ch] [bp-7Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 unsigned int v59; // [sp-18h] [bp-78h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 signed int v60; // [sp-14h] [bp-74h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 signed int v61; // [sp-10h] [bp-70h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 int v62; // [sp-Ch] [bp-6Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 int v63; // [sp-8h] [bp-68h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 unsigned int v64; // [sp-8h] [bp-68h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 int v65; // [sp-4h] [bp-64h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 int v66; // [sp-4h] [bp-64h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 int v68; // [sp+10h] [bp-50h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 int v69; // [sp+10h] [bp-50h]@140
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2408 unsigned int uFaceEvent; // [sp+14h] [bp-4Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 signed int v71; // [sp+18h] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 signed int v72; // [sp+1Ch] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 signed int v73; // [sp+20h] [bp-40h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 int v74; // [sp+20h] [bp-40h]@140
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2413 bool bFeatherFall; // [sp+24h] [bp-3Ch]@15
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2414 unsigned int uSectorID; // [sp+28h] [bp-38h]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 int v78; // [sp+2Ch] [bp-34h]@1
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2416 unsigned int uFaceID; // [sp+30h] [bp-30h]@1
8453114181af intermediate
Nomad
parents: 70
diff changeset
2417 int v80; // [sp+34h] [bp-2Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 int v81; // [sp+38h] [bp-28h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 int v82; // [sp+3Ch] [bp-24h]@47
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2420 int _view_angle; // [sp+40h] [bp-20h]@47
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 int bJumping; // [sp+44h] [bp-1Ch]@1
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2422 int new_party_y; // [sp+48h] [bp-18h]@1
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2423 int new_party_x; // [sp+4Ch] [bp-14h]@1
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2424 int party_z; // [sp+50h] [bp-10h]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 int v89; // [sp+58h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 int angle; // [sp+5Ch] [bp-4h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427
77
8b0c4d626477 Party movement
Nomad
parents: 76
diff changeset
2428 uFaceEvent = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 v89 = pParty->uFallSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 v1 = 0;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2431 new_party_y = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 v2 = 0;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2433 new_party_x = pParty->vPosition.x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2434 party_z = pParty->vPosition.z;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2435 uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 bJumping = 0;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2440 v80 = _46ED1B_collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 pParty->bFlying = 0;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2444 __debugbreak();
8453114181af intermediate
Nomad
parents: 70
diff changeset
2445 if (pParty->FlyActive())
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2448 if ( v80 == -30000 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2449 {
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2450 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
2451 if ( v80 == -30000 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 pParty->vPosition.x = blv_prev_party_x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2454 pParty->vPosition.y = blv_prev_party_z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2455 pParty->vPosition.z = blv_prev_party_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 pParty->uFallStartY = blv_prev_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 blv_prev_party_x = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2461 blv_prev_party_z = pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2462 blv_prev_party_y = pParty->vPosition.z;
77
8b0c4d626477 Party movement
Nomad
parents: 76
diff changeset
2463 if (!pParty->bTurnBasedModeOn)
8b0c4d626477 Party movement
Nomad
parents: 76
diff changeset
2464 {
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2465 auto v67 = GetTickCount() / 500;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2466 if (dword_720CDC != v67 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2467 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2468 dword_4F8580[3 * dword_4F8580[0] + 1] = pParty->vPosition.x;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2469 dword_4F8580[3 * dword_4F8580[0] + 2] = pParty->vPosition.y;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2470 dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 if ( dword_4F8580[0] > 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 dword_4F8580[0] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2474 dword_720CDC = v67;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2475 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2476 if (!pParty->FeatherFallActive())
8453114181af intermediate
Nomad
parents: 70
diff changeset
2477 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2478 bFeatherFall = false;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2479 if (!pParty->pPlayers[0].WearsItem(536, 16) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2480 !pParty->pPlayers[1].WearsItem(536, 16) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2481 !pParty->pPlayers[2].WearsItem(536, 16) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2482 !pParty->pPlayers[3].WearsItem(536, 16))
8453114181af intermediate
Nomad
parents: 70
diff changeset
2483 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2484 v6 = pParty->uFallStartY;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2485 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2486 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2487 else
8453114181af intermediate
Nomad
parents: 70
diff changeset
2488 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2489 v6 = v80;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2490 bFeatherFall = true;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2491 pParty->uFallStartY = v80;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2492 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2493 LABEL_20:
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2494 if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2500 else for (uint i = 0; i < 4; ++i)
8453114181af intermediate
Nomad
parents: 70
diff changeset
2501 { // receive falling damage
8453114181af intermediate
Nomad
parents: 70
diff changeset
2502 auto pPlayer = pParty->pPlayers + i;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2503
8453114181af intermediate
Nomad
parents: 70
diff changeset
2504 if (!pPlayer->HasEnchantedItemEquipped(72) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2505 !pPlayer->WearsItem(529, 8))
8453114181af intermediate
Nomad
parents: 70
diff changeset
2506 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2507 v8 = (signed __int64)((double)pPlayer->GetMaxHealth() * 0.1);
8453114181af intermediate
Nomad
parents: 70
diff changeset
2508 pPlayer->ReceiveDamage((pParty->uFallStartY - party_z) * (signed int)v8 / 256, 4);
8453114181af intermediate
Nomad
parents: 70
diff changeset
2509 v9 = pPlayer->GetActualEndurance();
8453114181af intermediate
Nomad
parents: 70
diff changeset
2510 v10 = (double)(20 - pPlayer->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2511 pPlayer->SetRecoveryTime((signed __int64)v10);
8453114181af intermediate
Nomad
parents: 70
diff changeset
2512 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2513 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2514 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2515 if ( party_z > v80 + 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 bJumping = 1;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2517 bFeatherFall = party_z - v80 <= 32;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2518 if ( party_z - v80 <= 32 )
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2519 pParty->uFallStartY = party_z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 if ( bWalkSound && pParty->field_6F8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2522 if ( party_z > v80 + 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2529 party_z = v80 + 1;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2530 pParty->uFallStartY = v80 + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 goto LABEL_45;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2533 if (pParty->field_6F4_packedid != uFaceID)
8453114181af intermediate
Nomad
parents: 70
diff changeset
2534 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2535 auto pFace = &pIndoor->pFaces[uFaceID];
8453114181af intermediate
Nomad
parents: 70
diff changeset
2536 if (pFace->uAttributes & 0x04000000 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2537 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2538 uFaceEvent = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 LABEL_44:
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2543 pParty->field_6F4_packedid = uFaceID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 LABEL_45:
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2545 v68 = uFaceID;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2546 if ( pIndoor->pFaces[uFaceID].uAttributes & 0x10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 v71 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 v81 = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 angle = pParty->sRotationY;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2550 _view_angle = pParty->sRotationX;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 / 180)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 case PARTY_TurnLeft:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2560 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 v13 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 case PARTY_TurnRight:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2567 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 v16 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 v14 = angle + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 v13 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 v14 = angle + (unsigned __int64)(signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 angle = stru_5C6E00->uDoublePiMask & v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 v16 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 v15 = (signed __int64)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 angle = stru_5C6E00->uDoublePiMask & (angle - v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 case PARTY_StrafeLeft:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2600 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 v18 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2603 //v88 = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 v19 = stru_5C6E00->SinCos(angle);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2607 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 case PARTY_StrafeRight:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2610 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 v21 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2613 //v88 = v21;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 v22 = stru_5C6E00->SinCos(angle);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2617 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 goto LABEL_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 case PARTY_WalkForward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2620 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 v23 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 v24 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2623 //v88 = v24;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2627 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 v1 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 case PARTY_WalkBackward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2632 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 v26 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 v27 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2635 //v88 = v27;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 v78 = (unsigned __int64)(v26
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2637 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 v78 = (unsigned __int64)(v28
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2641 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 LABEL_68:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 v1 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 case PARTY_RunForward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2648 //v29 = stru_5C6E00->SinCos(angle);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2649 //v30 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2650 //v88 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2651 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
2652 //v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2653 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
2654 v72 = 1;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
2655 goto LABEL_87;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 case PARTY_RunBackward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2657 //v32 = stru_5C6E00->SinCos(angle);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2658 //v33 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2659 //v88 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2660 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
2661 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2662 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
2663 //LABEL_70:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 v72 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 case PARTY_LookUp:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2667 __debugbreak();
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2668 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2669 if ( _view_angle > 128 )
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2670 _view_angle = 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 v63 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 case PARTY_LookDown:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2678 __debugbreak();
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2679 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2680 if ( _view_angle < -128 )
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2681 _view_angle = -128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 v63 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 pPlayers[v35]->PlaySound(v63, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 case PARTY_CenterView:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2692 __debugbreak();
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2693 _view_angle = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 case PARTY_Jump:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2696 __debugbreak();
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2697 if ( (!bJumping || party_z <= v80 + 6 && v89 <= 0) && pParty->field_24 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 v89 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 pParty->sRotationY = angle;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2709 pParty->sRotationX = _view_angle;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 v89 += -2 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 v89 -= pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 if ( bJumping != v36 && v89 <= v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 if ( v89 < -500 && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 (*v41)->PlayEmotion(46, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 LABEL_92:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2741 pParty->uFallStartY = party_z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 stru_721530.field_8 = pParty->field_14 >> 1;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2752 auto v83 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2757 new_party_z = party_z;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2758 stru_721530.field_34.x = new_party_x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2759 stru_721530.normal.x = new_party_x;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 stru_721530.field_1C = v2;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2761 stru_721530.field_34.y = new_party_y;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2762 stru_721530.normal.y = new_party_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 stru_721530.field_20 = v1;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2764 stru_721530.normal.z = stru_721530.prolly_normal_d + party_z + 1;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2765 stru_721530.field_34.z = stru_721530.field_C + party_z + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 stru_721530.field_24 = v89;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2767 stru_721530.uSectorID = uSectorID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 v38 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 if ( stru_721530._47050A(v38) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 _46E44E_collide_against_faces_and_portals(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 _46E0B2_collide_against_decorations();
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2778 for ( v80 = 0; v80 < (signed int)uNumActors; ++v80 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2779 _46DF1A_collide_against_actor(v80, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 while ( v73 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 v39 = stru_721530.normal2.x;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2788 uSectorID = stru_721530.normal2.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2793 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
2794 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
2795 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
2796 }
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2797 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
2798 if ( v42 == -30000 || v42 - new_party_z > 128 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2802 new_party_x = stru_721530.normal2.x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2803 new_party_y = stru_721530.normal2.y;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2804 new_party_z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 }
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2807 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
2808 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
2809 v43 = stru_721530.uFaceID;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2810 uSectorID = stru_721530.uSectorID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 stru_721530.field_70 += stru_721530.field_7C;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2812 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
2813 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 v53 = sub_452A9E(v2 * v2 + v1 * v1);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2824 v80 = v53;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 v54 = stru_5C6E00->Atan2(
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2826 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x,
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2827 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2830 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 v45 = v44->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 if ( v45 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 if ( v89 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 v87 = pIndoor->pVertices[*v44->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 if ( pParty->uFallStartY - v87 < 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 goto LABEL_143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 v46 = v89 * v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 v47 = v45 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 v48 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 {
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2857 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2858 if ( stru_721530.field_64 >> 3 > v80 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2859 v80 = stru_721530.field_64 >> 3;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2860 v50 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 v81 = v44->pFacePlane_old.vNormal.y;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2862 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 v82 = v44->pFacePlane_old.vNormal.z;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2864 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 v2 += v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 v74 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 v51 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 v69 = v44->pFacePlane_old.vNormal.x;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2870 v80 = v51;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 v1 += v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2872 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
2873 if ( v52 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2875 new_party_x += v52 * v69 >> 16;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2876 new_party_y += v52 * v80 >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 v87 += v52 * v74 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 LABEL_142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 LABEL_143:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 )
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2883 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2886 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2887 if ( stru_721530.field_64 >> 3 > v80 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2888 v80 = stru_721530.field_64 >> 3;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2889 v49 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 v81 = v44->pFacePlane_old.vNormal.y;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2891 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 v82 = v44->pFacePlane_old.vNormal.z;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2893 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 v2 += v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 if ( v2 * v2 + v1 * v1 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 goto LABEL_142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 v1 = (unsigned __int64)(58500i64 * v1) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 ++v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 v89 = (unsigned __int64)(58500i64 * v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 if ( v83 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2911 new_party_z = v87;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2917 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
2918 * (pParty->vPosition.y - new_party_y)
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2919 + (pParty->vPosition.z - new_party_z)
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2920 * (pParty->vPosition.z - new_party_z)) <= 16 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 goto LABEL_188;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2922 if ( v72 && (!bJumping || bFeatherFall) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 v56 = pAudioPlayer;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2934 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 v57 = (SoundID)50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 v57 = (SoundID)64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 v57 = (SoundID)63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2945 if ( v78 && (!bJumping || bFeatherFall) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 if ( v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 v57 = (SoundID)102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 v56 = pAudioPlayer;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2960 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 v57 = (SoundID)89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 v57 = (SoundID)103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 LABEL_188:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2974 if ( !bJumping || bFeatherFall )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 BYTE1(pParty->uFlags) &= 0xFDu;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2979 pParty->vPosition.x = new_party_x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2980 pParty->vPosition.z = new_party_z;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2981 pParty->vPosition.y = new_party_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 pParty->uFallSpeed = v89;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2983 if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 BYTE1(pParty->uFlags) |= 2u;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2985 if (uFaceEvent)
8453114181af intermediate
Nomad
parents: 70
diff changeset
2986 EventProcessor(uFaceEvent, 0, 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 //----- (00473893) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 void __cdecl ODM_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 int _zero; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 int v3; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 Player **v4; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 int v5; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 int v6; // esi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 ODMFace *v7; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 unsigned int v8; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 double v9; // st7@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 signed __int64 v10; // qax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 double v11; // st7@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 int v12; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 int v13; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 double v14; // st7@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 int v15; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 double v16; // st7@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 int v17; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 double v18; // st7@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 int v19; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 double v20; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 int v21; // eax@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 double v22; // st7@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 int v23; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 double v24; // st7@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 int v25; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 double v26; // st7@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 int v27; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 double v28; // st7@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 signed __int64 v29; // qax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 unsigned int v30; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 int v31; // eax@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 int v32; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 signed int v33; // eax@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 int v34; // esi@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 unsigned int v35; // esi@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 int v36; // eax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 signed int v37; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 signed int v38; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 signed int i; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 int v40; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 Player **v41; // esi@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 bool v42; // eax@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 signed int v43; // ecx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 signed int v44; // edx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 int v45; // ecx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 BSPModel *v46; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 ODMFace *v47; // esi@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 int v48; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 char v49; // zf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 char v50; // sf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 unsigned __int8 v51; // of@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 int v52; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 unsigned __int8 v53; // dl@205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 BSPModel *v54; // eax@215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 int v55; // eax@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 signed int v56; // ebx@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 int v57; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 BSPModel *v58; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 unsigned __int64 v59; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 BSPModel *v60; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 unsigned __int64 v61; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 int v62; // eax@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 signed int v63; // ST04_4@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 signed int v64; // eax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 unsigned int v65; // ebx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 unsigned int v66; // esi@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 int v67; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 signed int v68; // ecx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 int v69; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 int v70; // ebx@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 int v71; // esi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 int v72; // edi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 int v73; // eax@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 Player **v74; // esi@283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 int v75; // eax@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 unsigned int v76; // edi@293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 bool v77; // edx@297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 bool v78; // ecx@303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 int v79; // ecx@314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 __int16 v80; // dx@317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 int v81; // ebx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 int v82; // ecx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 int v83; // eax@321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 Player **v84; // esi@333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 int v85; // eax@334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 int v86; // [sp-20h] [bp-B4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 int v87; // [sp-20h] [bp-B4h]@248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 signed int v88; // [sp-1Ch] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 unsigned int v89; // [sp-18h] [bp-ACh]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 signed int v90; // [sp-14h] [bp-A8h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 signed int v91; // [sp-10h] [bp-A4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 int v92; // [sp-Ch] [bp-A0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 int v93; // [sp-8h] [bp-9Ch]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 unsigned int v94; // [sp-8h] [bp-9Ch]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 int v95; // [sp-4h] [bp-98h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 int v96; // [sp-4h] [bp-98h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 int v97; // [sp+Ch] [bp-88h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 int v98; // [sp+10h] [bp-84h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 int v99; // [sp+14h] [bp-80h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 int v100; // [sp+18h] [bp-7Ch]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 bool v101; // [sp+1Ch] [bp-78h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 int v102; // [sp+20h] [bp-74h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 int v103; // [sp+24h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 int bFeatherFall; // [sp+28h] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 int v105; // [sp+2Ch] [bp-68h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 int bWaterWalk; // [sp+30h] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 bool v107; // [sp+34h] [bp-60h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 int v108; // [sp+38h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 int v109; // [sp+3Ch] [bp-58h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 int v110; // [sp+40h] [bp-54h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 int v111; // [sp+44h] [bp-50h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 int bJumping; // [sp+48h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 int v113; // [sp+4Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 unsigned int v114; // [sp+50h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 int _walk_speed; // [sp+54h] [bp-40h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 int v116; // [sp+58h] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 int v117; // [sp+5Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 int v118; // [sp+60h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 Player **v119; // [sp+64h] [bp-30h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 int _angle_x; // [sp+68h] [bp-2Ch]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 int v121; // [sp+6Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 unsigned int v122; // [sp+70h] [bp-24h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 int v123; // [sp+74h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 int v124; // [sp+78h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 int _angle_y; // [sp+7Ch] [bp-18h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 int v126; // [sp+80h] [bp-14h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 BSPModel *v127; // [sp+84h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 int v128; // [sp+88h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 int v129; // [sp+8Ch] [bp-8h]@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 int v130; // [sp+90h] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 v121 = pParty->uFallSpeed;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3126 v123 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 v103 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 v116 = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3133 v117 = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 bJumping = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3136 v118 = GetTerrainHeightsAroundParty(pParty->vPosition.x, pParty->vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 v102 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 v119 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 while ( !(*v119)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 if ( (signed int)v119 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 if ( (signed __int64)pParty->pPartyBuffs[18].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 bWaterWalk = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 if ( !(pParty->pPartyBuffs[18].uFlags & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 && *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[18].uCaster + 10] <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 v3 = sub_46D49E_prolly_get_world_y_under_party(v116, v117, v123, pParty->uPartyHeight, &v130, &v108, bWaterWalk);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 v111 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 if ( bFeatherFall )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 pParty->uFallStartY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 v3 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 v4 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 if ( !(*v4)->HasEnchantedItemEquipped(72) && !(*v4)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 v105 = (*v4)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 (*v4)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(signed __int64)((double)v105 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 v5 = (*v4)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 v105 = 20 - (*v4)->_48EA1B_get_static_effect(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 (*v4)->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 while ( (signed int)v4 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 if ( pParty->bFlying != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 v107 = v108 == _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 v105 = v111 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 if ( v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 v101 = v123 - v111 <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 if ( bWalkSound != _zero && pParty->field_6F8 > _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 if ( !bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < _zero || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 if ( bJumping == _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 if ( pParty->field_6F4_packedid != (8 * v108 | OBJECT_BModel) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 if ( v108 != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 if ( v108 >> 6 < pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 v7 = (ODMFace *)&pOutdoor->pBModels[v108 >> 6].pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 v6 = v108 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 if ( *(char *)(v7->pFacePlane.vNormal.x + 308 * v6 + 31) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 }
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 _walk_speed = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 _angle_y = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 _angle_x = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 v126 = pEventTimer->dt_in_some_format;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 / 180)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 LABEL_118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 case PARTY_FlyUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3265 if ( pParty->vPosition.z < 4000 || bJumping )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 v123 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 v113 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 if ( v123 > 4000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 v123 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 v113 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 if ( v102 && v123 < v109 && (signed int)(pParty->uPartyHeight + v123) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 pParty->field_6E0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 pParty->field_6E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 BYTE1(pParty->uFlags) |= 1u;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3285 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 pParty->field_6F0 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 v123 = v109 - pParty->uPartyHeight - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 case PARTY_FlyDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 v123 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 v113 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 if ( v123 <= v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 v9 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 v11 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 v12 = v8 + _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 _angle_y = stru_5C6E00->uDoublePiMask & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 v9 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 _angle_y = stru_5C6E00->uDoublePiMask & (_angle_y + (unsigned __int64)(signed __int64)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 v11 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 v10 = (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 v12 = _angle_y - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 v13 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 v14 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 *(float *)&v128 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 v124 = (unsigned __int64)(v13 * (signed __int64)((signed int)(signed __int64)(v14 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v15 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 v16 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 v126 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 *(float *)&v128 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 v124 = (unsigned __int64)(v15 * (signed __int64)((signed int)(signed __int64)(v16 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v17 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 v18 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v126 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 *(float *)&v128 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v124 = (unsigned __int64)(v17 * (signed __int64)(signed int)(signed __int64)(v18 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 v1 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 v19 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v20 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 v126 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 *(float *)&v128 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 v124 = (unsigned __int64)(v19
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3399 * (signed __int64)(signed int)(signed __int64)(v20 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3404 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 v1 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 v21 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 v22 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 v126 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 *(float *)&v128 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 v129 = (unsigned __int64)(v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 * (unsigned __int64)(signed __int64)(v22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 v129 = (unsigned __int64)(v126
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)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 if ( v118 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 v23 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 v24 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 v126 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 *(float *)&v128 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 v129 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 v25 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 v26 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 v114 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 *(float *)&v128 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 v129 = (unsigned __int64)(v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 * (unsigned __int64)(signed __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 v114 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 v129 = (unsigned __int64)((signed int)v114
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)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 v27 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 v28 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 v126 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 *(float *)&v128 = v28;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3465 v29 = (signed __int64)(v28 * fBackwardWalkSpeedMultiplier);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 * (unsigned __int64)(signed __int64)(*(float *)&v128
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3474 * fBackwardWalkSpeedMultiplier))) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3486 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 v124 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 if ( _angle_x > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 _angle_x = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 v93 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 goto _play_player_sound;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 if ( _angle_x < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 _angle_x = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 v93 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 _play_player_sound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 pPlayers[v30]->PlaySound(v93, v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 _angle_x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 if ( (!v118 || v108) && !bJumping && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 v126 = pParty->field_24 << 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 v121 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v121);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 case PARTY_Land:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 BYTE1(pParty->uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 LABEL_123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 pParty->sRotationY = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 pParty->sRotationX = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 if ( v123 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 LABEL_130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 v31 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 v126 = stru_5C6E00->SinCos(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 v129 = (unsigned __int64)(4i64 * v126) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 v123 = v113 + v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 v123 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 goto LABEL_141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 if ( v130 && v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 sub_42F960_create_object(v116, v117, v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 pParty->uFallStartY = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 v113 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 LABEL_141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 if ( bJumping && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 v34 = v121 + 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 v121 += 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 if ( !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 if ( bJumping == v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 goto LABEL_164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 if ( !bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 if ( v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 _46DCC8_get_gravity_direction_outdoor(v116, v117, (Vec3_int_ *)&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 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
3597 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 v2 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v99) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 v1 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v100) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 v34 = (int)((char *)v127 + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 v121 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 LABEL_164:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 if ( !bUnderwater && v34 <= v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 if ( v34 < -500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 && !pParty->bFlying
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3614 && pParty->vPosition.z - v111 > 1000
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) && (*v41)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622 (*v41)->PlaySound(66, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 LABEL_150:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 if ( v2 * v2 + v1 * v1 < 400 && !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 v126 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 stru_721530.field_34.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 stru_721530.normal.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 stru_721530.field_34.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 stru_721530.normal.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 stru_721530.normal.z = stru_721530.prolly_normal_d + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 stru_721530.field_34.z = stru_721530.field_C + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 stru_721530.field_20 = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 stru_721530.field_24 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 v36 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 if ( stru_721530._47050A(v36) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 _46E889_collide_against_bmodels(1u);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3662 v37 = WorldPosToGridCellZ(pParty->vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 v38 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 _46E26D_collide_against_sprites(v38, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 _46ED8A_collide_against_layingItems(4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 _angle_x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 _angle_y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 _angle_x = v116 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 _angle_y = v117 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 v127 = (BSPModel *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 v40 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 v122 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 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
3683 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
3684 v119 = (Player **)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 v116,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690 &v110,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 v127 = (BSPModel *)GetTerrainHeightsAroundParty(_angle_x, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 v42 = GetTerrainHeightsAroundParty(v116, _angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 v118 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 if ( !v97 && !v110 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 v107 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 if ( bUnderwater || !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 if ( v127 && v129 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 if ( v118 && (signed int)v119 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 goto LABEL_198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 v127 = (BSPModel *)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 _angle_x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 &v108,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 if ( GetTerrainHeightsAroundParty(_angle_x, _angle_y) && (signed int)v127 <= v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 goto LABEL_199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 LABEL_198:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 LABEL_199:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 v116 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 v117 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 v123 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 v123 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 v56 = sub_452A9E(v2 * v2 + v128 * v128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 v118 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 v57 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 v129 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 v58 = (BSPModel *)stru_5C6E00->SinCos(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 v127 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 v59 = (signed int)v58 * (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 v122 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 v2 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 v60 = (BSPModel *)stru_5C6E00->SinCos(v129 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 v127 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 v61 = (signed int)v60 * (signed __int64)v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 v122 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 v128 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 v127 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 v48 = v47->pBoundingBox.z2 - v47->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 v51 = __OFSUB__(v48, 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 v49 = v48 == 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 v50 = v48 - 32 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 v52 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 v129 = (unsigned __int8)(v50 ^ v51 | v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 v119 = (Player **)(v52 < 46378);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 v53 = v47->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 if ( v53 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 if ( v121 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 v123 = v127->pVertices.pVertices[v47->pVertexIDs[0]].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 if ( v2 * v2 + v128 * v128 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 goto LABEL_221;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 if ( !v129 && (v53 != 4 || v119) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 v129 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 _walk_speed = v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 _walk_speed = (unsigned __int64)(v118 * (signed __int64)_walk_speed) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 v127 = (BSPModel *)v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3814 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815 v54 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817 v121 += (int)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 v128 += _walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 v55 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 - ((signed int)(v47->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 + v122 * v47->pFacePlane.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 + _angle_y * v47->pFacePlane.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 + _angle_x * v47->pFacePlane.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 if ( v55 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 v116 = _angle_x + (v47->pFacePlane.vNormal.x * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 v117 = _angle_y + (v47->pFacePlane.vNormal.y * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 v123 = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 LABEL_220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 LABEL_221:
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3835 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uAttributes) & 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 pParty->field_6F4_packedid = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 v103 = v47->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 v122 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 v127 = (BSPModel *)v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 v129 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 v121 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 v2 += v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 v128 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 if ( v2 * v2 + v128 * v128 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 goto LABEL_220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 v127 = (BSPModel *)58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 v122 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 ++v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 v121 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 while ( v126 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 v122 = abs(pParty->vPosition.x - v116);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3873 v126 = abs(pParty->vPosition.y - v117);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3874 v62 = abs(pParty->vPosition.z - v123);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 goto LABEL_344;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 if ( v114 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 if ( !v107
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3880 && !(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
3881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 v87 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 v86 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 LABEL_255:
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3901 v63 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 v64 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 v87 = pOutdoor->_47EE49(v64, v63, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 if ( v124 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 if ( v107
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3909 || 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
3910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 v87 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 LABEL_257:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 pAudioPlayer->PlaySound((SoundID)v87, v88, v89, v90, v91, v92, v94, v96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 LABEL_344:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 if ( !bJumping || v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 v126 = WorldPosToGridCellX(pParty->vPosition.x);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3944 v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 v114 = WorldPosToGridCellX(v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 v66 = WorldPosToGridCellZ(v117) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 v122 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v114, v65) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 v69 = ((unsigned int)~v67 >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 if ( v114 == v126 && v66 == v65 && v122 && v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 if ( v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 v70 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 v71 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 v72 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 v73 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 pParty->vPosition.x = v116;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3964 pParty->vPosition.y = v117;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3965 pParty->vPosition.z = v123;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 v73 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 pParty->uFallStartY = 8160;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3971 pParty->vPosition.z = 8160;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3975 && pParty->vPosition.y == v72
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3976 && (v73 = pParty->vPosition.z, pParty->vPosition.z == v70) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 if ( v73 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 v73 = v105;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3982 pParty->vPosition.z = v105;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 v74 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 v110 = (*v74)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 (*v74)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 (signed int)((pParty->uFallStartY - v70) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 v75 = (*v74)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 v110 = 20 - (*v74)->_48EA1B_get_static_effect(v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 (*v74)->SetRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 while ( (signed int)v74 <= (signed int)&pPlayers[4] );
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4005 v73 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 pParty->uFallStartY = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 if ( v102 && v73 < v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4014 pParty->vPosition.z = v109 - pParty->uPartyHeight - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 v76 = pParty->bFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 if ( pParty->bFlying || v101 == 0 || bWaterWalk || !v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 v77 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 v77 = v122 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 if ( !pParty->bFlying && v101 != 0 && !bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 v78 = v69 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 goto LABEL_306;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 LABEL_306:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 if ( v77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 pParty->vPosition.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 goto LABEL_313;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 goto LABEL_312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 if ( v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 LABEL_312:
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4049 pParty->vPosition.y = v117;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 LABEL_313:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 if ( bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 if ( !v122 || !v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 if ( !v76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 v80 = *(short *)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 LOBYTE(pParty->uFlags) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 *(short *)v79 = v80 & 0xFFFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 goto LABEL_318;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 LABEL_318:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 v81 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 v82 = v123;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4076 pParty->vPosition.z = v123;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 v82 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 pParty->uFallStartY = 8160;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4081 pParty->vPosition.z = 8160;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4088 v83 = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v110, 1);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4089 v82 = pParty->vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4090 if ( pParty->vPosition.z <= v83 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 pParty->uFlags |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v116)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4095 && pParty->vPosition.y == v117
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4096 && (v82 = pParty->vPosition.z, pParty->vPosition.z == v81) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 if ( v82 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4101 pParty->uFallSpeed = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4102 pParty->vPosition.z = v105;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 v84 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 v110 = (*v84)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 (*v84)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 (signed int)((pParty->uFallStartY - v81) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 v85 = (*v84)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 while ( (signed int)v84 <= (signed int)&pPlayers[4] );
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4124 v82 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 pParty->uFallStartY = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4131 pParty->vPosition.z = v82 + pParty->uPartyHeight - v109 + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 //----- (0047531C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 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
4143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 BLVFace *v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 int v11; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 int v12; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 int v13; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 int v14; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 signed __int64 v15; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 __int16 v16; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 int *v18; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 int v19; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 int a9b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 int a9a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 int a10b; // [sp+3Ch] [bp+24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 signed int a10a; // [sp+3Ch] [bp+24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 int a10c; // [sp+3Ch] [bp+24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 v10 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 v19 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 if ( a10 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 v11 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 a10b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 a9b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 v12 = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 a9a = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 v13 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 - a5 * v10->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 - v10->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 - a5 * v10->pFacePlane_old.vNormal.z - v10->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 a10c = abs(v13) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 if ( a10c > abs(v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 LODWORD(v15) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 HIDWORD(v15) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 v14 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 a10a = v15 / a9a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 a10a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 v14 = abs(v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 v16 = a4 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 HIWORD(a7a) = v16 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 if ( !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 *v18 = a10a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 if ( a10a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 //----- (004754BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 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
4213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 BLVFace *v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 int v12; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 int v13; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 int v14; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 int v15; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 signed __int64 v16; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 __int16 v17; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 int *v19; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 int v20; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 int a1b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 int a1a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 int a11b; // [sp+40h] [bp+28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 signed int a11a; // [sp+40h] [bp+28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 int a11c; // [sp+40h] [bp+28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 v11 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 v19 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 v20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 if ( a11 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 v12 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 a11b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 a1b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 v13 = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 a1a = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 v14 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 - a5 * v11->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 - v11->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 - a5 * v11->pFacePlane_old.vNormal.z - v11->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 a11c = abs(v14) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 if ( a11c > abs(v13) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 LODWORD(v16) = v14 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 HIDWORD(v16) = v14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 v15 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 a11a = v16 / a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 a11a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 v15 = abs(v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 v17 = a4 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 HIWORD(a7a) = v17 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 if ( !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 *v19 = a11a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 if ( a11a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 *v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 //----- (00475665) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 Vec3_short_ *v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 signed int v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 Vec3_short_ *v8; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 signed int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 int v10; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 signed int v11; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 Vec3_short_ *v12; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 signed int v13; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 int v15; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 bool v16; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 signed int v18; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 int v19; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 signed int v20; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 int v21; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 signed int v22; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307 signed __int64 v23; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 signed int result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 int v25; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 int v26; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 signed int v27; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 signed int v28; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 signed int v29; // [sp+30h] [bp+Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 signed int v30; // [sp+30h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 signed int v31; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 v3 = _this->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 if ( BYTE1(v3) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322 v27 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 v4 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 v5 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 v6 = 2 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 word_720C10_intercepts_xs[2 * v28] = _this->pXInterceptDisplacements[v28] + v4[_this->pVertexIDs[v28]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 word_720B40_intercepts_zs[2 * v28] = _this->pYInterceptDisplacements[v5] + v4[_this->pVertexIDs[v5]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 word_720C10_intercepts_xs[2 * v28++ + 1] = _this->pXInterceptDisplacements[v5 + 1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 + v4[_this->pVertexIDs[v5 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 word_720B40_intercepts_zs[v6 + 1] = _this->pYInterceptDisplacements[v5 + 1] + v4[_this->pVertexIDs[v5 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 while ( v28 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 if ( BYTE1(v3) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 v7 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 v27 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 v8 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 v9 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 v10 = 2 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 word_720C10_intercepts_xs[2 * v29] = _this->pXInterceptDisplacements[v29] + v8[_this->pVertexIDs[v29]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 word_720B40_intercepts_zs[2 * v29] = _this->pZInterceptDisplacements[v9] + v8[_this->pVertexIDs[v9]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 word_720C10_intercepts_xs[2 * v29++ + 1] = _this->pXInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 word_720B40_intercepts_zs[v10 + 1] = _this->pZInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 while ( v29 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 v26 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 v11 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 v27 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 v12 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 v13 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 v14 = 2 * v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 word_720C10_intercepts_xs[2 * v30] = _this->pYInterceptDisplacements[v30] + v12[_this->pVertexIDs[v30]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 word_720B40_intercepts_zs[2 * v30] = _this->pZInterceptDisplacements[v13] + v12[_this->pVertexIDs[v13]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 word_720C10_intercepts_xs[2 * v30++ + 1] = _this->pYInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 word_720B40_intercepts_zs[v14 + 1] = _this->pZInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 while ( v30 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 v15 = 2 * _this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 word_720C10_intercepts_xs[2 * _this->uNumVertices] = word_720C10_intercepts_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 word_720B40_intercepts_zs[v15] = word_720B40_intercepts_zs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 v16 = word_720B40_intercepts_zs[0] >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 if ( v15 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 if ( v31 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 v17 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 v18 = word_720B40_intercepts_zs[v25 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 if ( v16 ^ v18 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 v19 = word_720C10_intercepts_xs[v17 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 if ( v19 >= v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 v21 = v20 | word_720C10_intercepts_xs[v17] < v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 if ( v21 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 if ( !v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 || (v22 = v19 - word_720C10_intercepts_xs[v17],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 LODWORD(v23) = v22 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 HIDWORD(v23) = v22 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 word_720C10_intercepts_xs[v17]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 + ((signed int)(((unsigned __int64)(v23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 / (v18 - word_720B40_intercepts_zs[v17])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 * ((v27 - (signed int)word_720B40_intercepts_zs[v17]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 + 32768) >> 16) >= v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 v16 = v18 >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 while ( v25 < v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 if ( v31 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 //----- (004759C9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436 __int16 v6; // si@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 __int16 v8; // si@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 int v9; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 __int16 v10; // si@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 int v11; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 bool v12; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 int v15; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 signed int v16; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 int v17; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 signed int v18; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 signed __int64 v19; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 bool result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 int v21; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 signed int v22; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 int v23; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 signed int v24; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 Vec3_int_ **a4a; // [sp+30h] [bp+Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 Vec3_int_ **a4b; // [sp+30h] [bp+Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 Vec3_int_ **a4c; // [sp+30h] [bp+Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 signed int a4d; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 v4 = a1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 if ( BYTE1(v4) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 v24 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 a4a = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 v5 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 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
4475 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
4476 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 if ( BYTE1(v4) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 a4b = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 v7 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 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
4496 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
4497 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 v23 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 a4c = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 v9 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 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
4515 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
4516 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 v11 = 2 * a1->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 a4d = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 word_720A70_intercepts_xs_plus_xs[2 * a1->uNumVertices] = word_720A70_intercepts_xs_plus_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 word_7209A0_intercepts_ys_plus_ys[v11] = word_7209A0_intercepts_ys_plus_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 v12 = word_7209A0_intercepts_ys_plus_ys[0] >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 if ( v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 if ( a4d >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 v13 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 v14 = word_7209A0_intercepts_ys_plus_ys[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 if ( v12 ^ v14 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 v15 = word_720A70_intercepts_xs_plus_xs[v13 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 if ( v15 >= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 v17 = v16 | word_720A70_intercepts_xs_plus_xs[v13] < v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 if ( v17 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 if ( !v17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 || (v18 = v15 - word_720A70_intercepts_xs_plus_xs[v13],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 LODWORD(v19) = v18 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 HIDWORD(v19) = v18 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 word_720A70_intercepts_xs_plus_xs[v13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 + ((signed int)(((unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 / (v14 - word_7209A0_intercepts_ys_plus_ys[v13])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 * ((v24 - (signed int)word_7209A0_intercepts_ys_plus_ys[v13]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 + 32768) >> 16) >= v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 ++a4d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 v12 = v14 >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 while ( v21 < v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 if ( a4d != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 //----- (00475D85) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 BLVFace *v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 int v5; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 int v6; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 int v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 signed int v9; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 signed __int64 v10; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 Vec3_int_ *v11; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 int v12; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 Vec3_int_ *v14; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 Vec3_int_ *v15; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 int v16; // [sp+18h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 int v17; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 int a4b; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 int a4c; // [sp+30h] [bp+Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 signed int a4a; // [sp+30h] [bp+Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 if ( BYTE3(a4->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 || (v5 = (unsigned __int64)(a2->x * (signed __int64)a4->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 a4b = (unsigned __int64)(a2->y * (signed __int64)a4->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 v6 = (unsigned __int64)(a2->z * (signed __int64)v4->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 v7 = v5 + v6 + a4b,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 (v16 = v5 + v6 + a4b) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 || v7 > 0 && !(v4->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 v8 = v4->pFacePlane_old.vNormal.z * a1->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 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
4602 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 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
4605 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 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
4613 if ( a4c > abs(v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 || (LODWORD(v10) = v9 << 16, HIDWORD(v10) = v9 >> 16, a4a = v10 / v16, v17 = v10 / v16, v17 > *a3 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 || (v11 = v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 LOWORD(v12) = LOWORD(v14->x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->x) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 HIWORD(v12) = LOWORD(v11->y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->y) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 LOWORD(v11->z) + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->z) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 *a3 = a4a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 //----- (00475F30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 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
4631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 BLVFace *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 int v10; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 int v11; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 int v12; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 char v13; // zf@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 int v14; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 signed int v16; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 int v17; // ST20_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 signed __int64 v18; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 int v19; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 int *v21; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 int v22; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 int v23; // [sp+1Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 signed int v24; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 if ( BYTE3(a2->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 || (v10 = (unsigned __int64)(a6 * (signed __int64)a2->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 v11 = (unsigned __int64)(a7 * (signed __int64)a2->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 v12 = (unsigned __int64)(a8 * (signed __int64)a2->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 v13 = v10 + v12 + v11 == 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 v14 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 v22 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 v13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 || v14 > 0 && !(a2->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 v15 = a4 * a2->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 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
4662 if ( v14 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 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
4665 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 if ( v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 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
4673 if ( v17 > abs(v14)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 || (LODWORD(v18) = v16 << 16, HIDWORD(v18) = v16 >> 16, v24 = v18 / v22, v23 = v18 / v22, v23 > *v21 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 || (LOWORD(v19) = a3 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a6) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 HIWORD(v19) = a4 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a7) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 a9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 a5 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a8) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 *v21 = v24 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 //----- (004760D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 PartyAction ActionQueue::Next()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 if (!uNumActions)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 return PARTY_INVALID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 auto result = pActions[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 for (unsigned int i = 0; i < uNumActions - 1; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 pActions[i] = pActions[i + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 --uNumActions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 //----- (00476387) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 bool __cdecl sub_476387()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 //----- (00476395) --------------------------------------------------------
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
4712 //0x26 Wizard eye at skill level 2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 signed int v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 if ( bNoNPCHiring == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 if ( (signed int)pNPCStats->uNumNewNPCs <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 if ( pParty->pHirelings[0].uProfession != uProfession )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 LOBYTE(result) = pParty->pHirelings[1].uProfession == uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 v3 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 while ( *((int *)v3 + 4) != uProfession || !(*v3 & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 if ( v2 >= (signed int)pNPCStats->uNumNewNPCs )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 // 6BE3C5: using guessed type char bNoNPCHiring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 //----- (004763E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 void __cdecl InitializeAwards()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 char v2; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 char *v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 int v4; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 signed int v5; // [sp+Ch] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 char *v6; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 Award *v7; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 if ( pAwardsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 pAllocator->FreeChunk(pAwardsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 pAwardsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 pAwardsTXT_Raw = (char *)pEvents_LOD->LoadRaw("awards.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 strtok(pAwardsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 v7 = pAwards;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4768 for (uint i = 0; i < 104; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 v5 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 v2 = v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 while ( v2 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 v4 = (int)&v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 if ( v1[(int)v3] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 *(char *)v4 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 if ( v3 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 if ( v6 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 v7->pText = RemoveQuotes(v1);
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 *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 v7->uSort = atoi(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 v1 = (char *)(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 while ( (signed int)(v6 - 1) <= 2 && (char *)v5 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4815 //while ( (signed int)v7 < (signed int)&dword_7241C8 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 // 7241C8: using guessed type int dword_7241C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 //----- (004764C2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 void __cdecl InitializeScrolls()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 const char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 if ( pScrollsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 pAllocator->FreeChunk(pScrollsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 pScrollsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 pScrollsTXT_Raw = (char *)pEvents_LOD->LoadRaw("scroll.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 strtok(pScrollsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 v6 = pScrolls;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4838 for (uint i = 0; i < 82; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 *v6 = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4878 //while ( (signed int)v6 < (signed int)dword_723E80_award_related );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4879 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4880
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 //----- (00476590) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 void __cdecl InitializeMerchants()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 char *v0; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4886 //char **v1; // edi@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 char *v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 char *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 signed int v6; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 char *v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 if ( pMerchantsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 pAllocator->FreeChunk(pMerchantsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 pMerchantsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 pMerchantsTXT_Raw = (char *)pEvents_LOD->LoadRaw("merchant.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 strtok(pMerchantsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4900 //v1 = (char **)pMerchantsRepairPhrases;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4901 for (uint i = 0; i < 7; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 v6 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 v2 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 v3 = v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 v5 = (int)&v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 if ( v2[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 if ( v7 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4934 pMerchantsBuyPhrases[i] = RemoveQuotes(v2);
0
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 *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4940 pMerchantsSellPhrases[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 *)3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4946 pMerchantsRepairPhrases[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 - 3 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4951 pMerchantsIdentifyPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 while ( (signed int)(v7 - 1) <= 4 && (char *)v6 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4960 //++v1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4961 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4962 //while ( (signed int)v1 < (signed int)pMerchantsIdentifyPhrases );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 //----- (00476682) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 void __cdecl InitializeTransitions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 if ( pTransitionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 pAllocator->FreeChunk(pTransitionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 pTransitionsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 pTransitionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("trans.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 strtok(pTransitionsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 v6 = pTransitionStrings;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4984 for (uint i = 0; i < 464; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 *v6 = (char *)RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5024 //while ( (signed int)v6 < (signed int)"awards.txt" );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 //----- (00476750) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 void __cdecl InitializeAutonotes()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 char *v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 int v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 char *v2; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 char v3; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 int v5; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 signed int v6; // [sp+0h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 if ( pAutonoteTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 pAllocator->FreeChunk(pAutonoteTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 pAutonoteTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 pAutonoteTXT_Raw = (char *)pEvents_LOD->LoadRaw("autonote.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 strtok(pAutonoteTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 v0 = (char *)&stru_723720[0].eType;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5044 for (uint i = 0; i < 195; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047 v2 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 while ( v3 != 9 && v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 v3 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 v5 = (int)&v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 if ( !v2[v4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 *(char *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 if ( v1 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 *((int *)v0 - 1) = (int)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 if ( v1 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 if ( _strcmpi(v2, "potion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 if ( _strcmpi(v2, "stat") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 if ( _strcmpi(v2, "seer") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 if ( _strcmpi(v2, "obelisk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 *(int *)v0 = 5 - (_strcmpi(v2, "teacher") != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 *(int *)v0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 *(int *)v0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 *(int *)v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 *(int *)v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 while ( v1 - 1 <= 2 && !v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 v0 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5110 //while ( (signed int)v0 < (signed int)&pScrolls[1] );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5111 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5112
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 //----- (004768A9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 void __cdecl InitializeQuests()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 int v5; // esi@9
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5123 //const char **v6; // [sp+10h] [bp-8h]@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 if ( pQuestsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 pAllocator->FreeChunk(pQuestsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 pQuestsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 pQuestsTXT_Raw = (char *)pEvents_LOD->LoadRaw("quests.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 strtok(pQuestsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5132
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5133 //v6 = pQuestTable;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5134 for (uint i = 0; i < 512; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5135 //do
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 if ( *v1 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 while ( v3 != '\t' );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 if ( v2 == 1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5167 pQuestTable[i] = RemoveQuotes(v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5173 //++v6;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5174 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5175 //while ( (signed int)v6 < (signed int)&unk_723714 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 //----- (00476977) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 void NPCStats::Initialize2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 char *v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 char v10; // dl@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 char *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 int v12; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 char *v14; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 char v15; // dl@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 int v16; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 int v17; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 char v18; // zf@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 NPCStats_stru0 *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 signed int v20; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 signed int v21; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 char *v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 char *v23; // [sp+10h] [bp-10h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 char *v25; // [sp+14h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 char *v26; // [sp+14h] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 signed int v27; // [sp+14h] [bp-Ch]@39
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5204 //signed int v28; // [sp+18h] [bp-8h]@3
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5205 //signed int v29; // [sp+18h] [bp-8h]@20
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 signed int v30; // [sp+18h] [bp-8h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 char *v31; // [sp+1Ch] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5209 //v1 = this;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5210 //v2 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5211 if (pNPCTextTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5212 pAllocator->FreeChunk(pNPCTextTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5213
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5214 //v3 = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5215 pNPCTextTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5216 strtok(pNPCTextTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5217
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5218 for (uint i = 0; i < 789; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5219 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5220 v4 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5221 v22 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5222 v25 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 if ( *v4 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 {
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 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 v5 = v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 while ( v5 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5237 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 v7 = (int)&v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 if ( !v4[(int)v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 *(char *)v7 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5243 if ( v6 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 if ( v22 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5250 pNPCTopics[i].pText = RemoveQuotes(v4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 v4 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5255 while ( (signed int)(v22 - 1) <= 1 && v25 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5256 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5257
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5258 if (pNPCTopicTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5259 pAllocator->FreeChunk(pNPCTopicTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5260
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5261 //v8 = (char *)pEvents_LOD->LoadRaw("npctopic.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5262 pNPCTopicTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctopic.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5263 strtok(pNPCTopicTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5264
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5265 for (uint i = 0; i < 579; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5266 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5267 v9 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5268 v23 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5269 v26 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 {
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 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281 v10 = v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 while ( v10 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5284 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 v12 = (int)&v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 if ( !v9[(int)v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 *(char *)v12 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5290 if ( v11 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 if ( v23 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5297 pNPCTopics[i].pTopic = RemoveQuotes(v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5302 while ( (signed int)(v23 - 1) <= 1 && v26 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5303 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5304
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5305 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5306 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5307
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5308 //v13 = (char *)pEvents_LOD->LoadRaw("npcdist.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5309 pNPCDistTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcdist.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5310 strtok(pNPCDistTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5311 strtok(nullptr, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 v30 = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5313 v31 = &array_16544[0].field_4[1];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5314
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5315 char *v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5318 v14 = strtok(nullptr, "\r") + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 v27 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5320 char *v24 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 if ( *v14 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326 {
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 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334 while ( v15 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 v2 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 if ( (signed int)v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 if ( (signed int)v2 < 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5351 array_16544[(int)v2].field_4[v30] = atoi(v14);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 *v31 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 while ( (signed int)(v2 - 1) <= 77 && !v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 if ( v30 < 59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5373 v19 = array_16544;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 v20 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 v19->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 v19->field_0 += v19->field_4[v21++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 while ( v21 < 59 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 --v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 while ( v20 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5386
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5387 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5388 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5389 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5390 pNPCDistTXT_Raw = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 //----- (00476C60) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 void NPCStats::_476C60()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 {
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5397 for (uint i = 1; i < uNumNewNPCs; ++i)
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5398 pNewNPCData[i].pName = pNPCNames2[i - 1];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5399
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5400 if (pParty->pHirelings[0].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 pParty->pHirelings[0].pName = pParty->pHireling1Name;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5402 if (pParty->pHirelings[1].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 pParty->pHirelings[1].pName = pParty->pHireling2Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 //----- (00476CB5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 void NPCStats::Initialize1()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 char *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411 char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412 char *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 char v5; // dl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 char *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 char *v8; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 char v10; // dl@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 int v11; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 int v12; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 char *v13; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 char *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423 char v15; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 int v16; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 int v17; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 char *v18; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 char *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 char v20; // cl@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 int v21; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 int v22; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 int v23; // [sp+Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 signed int v24; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 signed int v25; // [sp+10h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 signed int v26; // [sp+10h] [bp-10h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 signed int v27; // [sp+10h] [bp-10h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 char *Str; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 NPCGreeting *pGreetings; // [sp+14h] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 unsigned __int16 *pGroups; // [sp+14h] [bp-Ch]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 char **pCatchPhrase; // [sp+14h] [bp-Ch]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 signed int v32; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 signed int v33; // [sp+18h] [bp-8h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 signed int v34; // [sp+18h] [bp-8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 signed int v35; // [sp+18h] [bp-8h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 signed int v36; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 signed int v37; // [sp+1Ch] [bp-4h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 signed int v38; // [sp+1Ch] [bp-4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 signed int v39; // [sp+1Ch] [bp-4h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 v2 = (char *)pEvents_LOD->LoadRaw("npcdata.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 v1->pNPCDataTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 strtok(v2, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 v3 = (char *)&v1->pNPCData[1].house;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 Str = (char *)v1->pNPCNames2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 v24 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 v4 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 v36 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 v23 = (int)&v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 v32 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 switch ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 v7 = RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 *((int *)v3 - 5) = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 *(int *)Str = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 *((int *)v3 - 4) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 *(int *)v3 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 *((int *)v3 + 1) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 *((int *)v3 + 2) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 *((int *)v3 + 3) = *v4 == 121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 *((int *)v3 + 5) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 *((int *)v3 + 6) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 *((int *)v3 + 7) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 *((int *)v3 + 8) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 *((int *)v3 + 9) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 *((int *)v3 + 10) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 v4 = (char *)(v23 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 while ( v36 + 1 <= 15 && !v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 Str += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 --v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 while ( v24 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 v1->uNumNewNPCs = 501;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 v8 = (char *)pEvents_LOD->LoadRaw("npcgreet.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 v1->pNPCGreetTXT_Raw = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 strtok(v8, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 pGreetings = v1->pNPCGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 v25 = 205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 while ( v10 != 9 && v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 v12 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 v33 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 *(char *)v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 pGreetings->pGreeting1 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 pGreetings->pGreeting2 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 while ( v37 <= 2 && !v33 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 ++pGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 --v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 while ( v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 v13 = (char *)pEvents_LOD->LoadRaw("npcgroup.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 v1->pNCPGroupTXT_Raw = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 strtok(v13, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 pGroups = v1->pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 v14 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 while ( v15 != 9 && v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 v34 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 if ( v16 && v38 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 *pGroups = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 while ( v38 <= 1 && !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 ++pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 --v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 while ( v26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 v18 = (char *)pEvents_LOD->LoadRaw("npcnews.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 v1->pNPCNewsTXT_Raw = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 strtok(v18, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 pCatchPhrase = v1->pCatchPhrases;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 v27 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 v19 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 v20 = *v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 while ( v20 != 9 && v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 v20 = v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 v22 = (int)&v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 if ( !v19[v21] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 *(char *)v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 if ( v21 && v39 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 *pCatchPhrase = (char *)RemoveQuotes(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 v19 = (char *)(v22 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 while ( v39 <= 1 && !v35 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 ++pCatchPhrase;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 --v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 while ( v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 //----- (0047702F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 void NPCStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5645 //NPCStats *v1; // edi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 char *v2; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5647 //char *v3; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 char *v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 char v5; // al@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 int v6; // ecx@4
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5651 //char *v7; // eax@18
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 char *v8; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 char *v9; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 char v10; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 char v12; // zf@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 signed int v13; // [sp+Ch] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 int v14; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 int v15; // [sp+10h] [bp-10h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 char *v16; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 signed int v17; // [sp+14h] [bp-Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 unsigned int v18; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 char *v19; // [sp+18h] [bp-8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 signed int v20; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 signed int v21; // [sp+1Ch] [bp-4h]@19
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5666 //v1 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 Initialize1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 Initialize2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 InitializeQuests();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 InitializeAutonotes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 InitializeAwards();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 InitializeTransitions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 InitializeMerchants();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 InitializeScrolls();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 v2 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5678 field_17FC0 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5679 pNPCNamesTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5680 //v3 = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5681 pNPCNamesTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5682 strtok(pNPCNamesTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 v18 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5684 v16 = (char *)pNPCNames;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 v4 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 if ( *v4 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 if ( v5 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 v14 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 *((int *)v16 + 1) = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 *(int *)v16 = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 LABEL_45:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5723 if ( v20 == 1 && !uNumNPCNames[1] )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5724 uNumNPCNames[1] = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 v4 += v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 while ( v20 <= 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 v16 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 if ( (signed int)v18 >= 540 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5736 pNPCProfTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5737 uNumNPCNames[0] = v18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5738 //v7 = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5739 pNPCProfTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5740 strtok(pNPCProfTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 strtok(0, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5744 v8 = (char *)&pProfessions[0].pJoinText;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5745 v19 = (char *)&pProfessions[0].pJoinText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746 v13 = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 {
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 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 while ( v10 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 v8 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 v15 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 switch ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 *((int *)v8 - 3) = atoi(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 *((int *)v8 - 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 *((int *)v8 - 2) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 *(int *)v8 = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 *((int *)v8 + 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 v9 = (char *)(v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 while ( v21 <= 6 && !v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 v8 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 v12 = v13-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 v19 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 while ( !v12 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5807 uNumNPCProfessions = 59;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 //----- (00477266) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 void NPCStats::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 void *v2; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 pAllocator->FreeChunk(this->pNPCTopicTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 v2 = v1->pNPCTextTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 pAllocator->FreeChunk(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 pAllocator->FreeChunk(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 pAllocator->FreeChunk(v1->pNPCProfTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 v1->pNPCProfTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 pAllocator->FreeChunk(v1->pNPCNamesTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 v1->pNPCNamesTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 pAllocator->FreeChunk(v1->pNPCDataTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 v1->pNPCDataTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 pAllocator->FreeChunk(v1->pNPCDistTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 v1->pNPCDistTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 v3 = (int)&v1->pNPCGreetTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 pAllocator->FreeChunk(v1->pNPCGreetTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 v1 = (NPCStats *)((char *)v1 + 98296);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 *(int *)v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 pAllocator->FreeChunk(v1->pNPCData[0].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 v1->pNPCData[0].pName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 //----- (0047730C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5842 int __fastcall const_1(int a1, int)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 //----- (0047732C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5849 bool NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5850 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5851 //NPCStats *v5; // ebx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 signed __int64 v6; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 int v8; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5855 NPCData *v9; // edi@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5856 int v10; // eax@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5857 //int v11; // eax@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5858 int v12; // ecx@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5859 int v13; // edx@28
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5860 int v14; // esi@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5861 int v15; // edx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5862 int v16; // ecx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5863 int v17; // eax@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5864 int v18; // edx@37
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865 signed int result; // eax@39
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5866 int v20; // [sp+Ch] [bp-Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5867 signed int v21; // [sp+10h] [bp-8h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5868 signed int v22; // [sp+14h] [bp-4h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5869 int v23; // [sp+24h] [bp+Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5870
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5871
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5872 v23 = a3 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5873 //v5 = this;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5874 v6 = (signed __int64)((double)v23 * -0.33333334);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5875 v7 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 28];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5876 v20 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 116];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5877 v8 = rand() % uNumNPCNames[v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5878 v9 = a2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 a2->uSex = v7;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5880 a2->pName = pNPCNames[v8][v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5881 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5882 v22 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5883 v21 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5884
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5886 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5887 if ( v20 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5888 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5889 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5890 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5891 v23 = 2;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5892 a2 = (NPCData *)100;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5893 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5894 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5895 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5896 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5897 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5898 v23 = 201;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5899 a2 = (NPCData *)250;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5900 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5901 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5902 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5903 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5904 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5905 switch ( v20 - v10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5907 case 1:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5908 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5909 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5910 v23 = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5911 a2 = (NPCData *)430;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5914 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5915 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5916 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5917 v23 = 460;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5918 a2 = (NPCData *)490;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5919 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5921 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5922 case 2:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5923 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5924 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5925 v23 = 500;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5926 a2 = (NPCData *)520;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5930 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5931 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5932 v23 = 530;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5933 a2 = (NPCData *)550;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5934 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 case 3:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5938 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5939 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5940 v23 = 300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5941 a2 = (NPCData *)330;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5945 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5946 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5947 v23 = 360;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5948 a2 = (NPCData *)387;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5949 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5951 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5953 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5954 v12 = v23 + rand() % ((int)a2 - v23 + 1);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5955 if ( const_1(v12, v7) == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5956 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5957 ++v22;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5958 if ( v22 >= 4 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5959 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5960 v12 = v23;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5961 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5962 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5963 if ( v21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5964 break;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5965 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5966 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5967
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5968 v9->uPortraitID = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5969 v9->uFlags = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5970 v9->fame = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5971 v13 = rand() % 100 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5972
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5973 if ( v13 >= 60 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5974 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5975 if ( v13 >= 90 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5976 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5977 if ( v13 >= 95 )
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 >= 98 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5980 v9->rep = -600;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5981 else
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5982 v9->rep = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5983 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5984 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5985 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5986 v9->rep = -300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5987 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5988 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5989 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5990 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5991 v9->rep = 200;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5992 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5993 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5994 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5995 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5996 v9->rep = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5997 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5998
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5999 //v14 = (int)((char *)v5 + 64 * a5);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6000 //v15 = rand() % *(_DWORD *)(v14 + 91460);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6001 v15 = rand() % array_16544[a5].field_0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6002 v16 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6003 v17 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6004 v18 = v15 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6005
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6006 if ( v18 > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6007 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6008 do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6009 //v14 += *(char *)(v14 + v17++ + 0x16548);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6010 v16 += array_16544[a5].field_4[v17++];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6011 while ( v16 < v18 );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6012 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6013 v9->uProfession = v17 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6014 v9->house = a4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6015 v9->field_24 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6016 v9->joins = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6017 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6019 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6020
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6021 //----- (0047752B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6022 int __cdecl GetPartyReputation()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 DDM_DLV_Header *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 signed int v1; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 v0 = &pOutdoor->ddm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 v0 = &pIndoor->dlv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 if ( CheckHiredNPCSpeciality(0x2Du) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032 v1 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 if ( CheckHiredNPCSpeciality(0x33u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 if ( CheckHiredNPCSpeciality(0x30u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 if ( CheckHiredNPCSpeciality(0x32u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 if ( CheckHiredNPCSpeciality(0x34u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 return v1 + v0->uReputation;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 //----- (004775ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 if ( *(float *)(v4 - 15) <= (double)a2 && *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 if ( *(float *)v5 <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 if ( *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 //----- (00477927) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 int stru6_stru1_indoor_sw_billboard::_477927(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 if ( *(float *)(v4 - 15) >= (double)a2 && *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 if ( *(float *)v5 >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 if ( *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6307 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6308 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6309 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6310 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6311 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6318 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6319 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6320 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6321 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6322 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6323 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6324 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6325 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6326 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6327 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6328 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6329 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6330 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6331 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6332 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6333 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 //----- (00477C61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 int stru6_stru1_indoor_sw_billboard::sub_477C61()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 stru6_stru1_indoor_sw_billboard *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 int v2; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 double v5; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 double v6; // st6@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 double v7; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 float v8; // ST30_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 float v9; // ST24_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 double v10; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 double v11; // st6@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 double v12; // st5@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 float v13; // ST24_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 char *v15; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 signed int v16; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 __int16 v17; // fps@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 unsigned __int8 v18; // c2@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 unsigned __int8 v19; // c3@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 double v20; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 float v21; // ST18_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 float v22; // ST2C_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 float v23; // ST34_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 float v24; // ST24_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 double v25; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 double v26; // st6@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 float v27; // ST34_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 float v28; // ST30_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 int v29; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 signed int v31; // [sp+8h] [bp-28h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 float v32; // [sp+Ch] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 float v33; // [sp+14h] [bp-1Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 float v34; // [sp+18h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 float v35; // [sp+1Ch] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 float v36; // [sp+20h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 float v37; // [sp+24h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 float v38; // [sp+24h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 float v39; // [sp+28h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 float v40; // [sp+28h] [bp-8h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 float v41; // [sp+2Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 float v42; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6386
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6387 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6388 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6390 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6391 if ( v1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6393 v3 = (int)&v1->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6394 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6396 v4 = *(float *)(v3 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6397 LODWORD(v37) = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6398 LODWORD(v36) = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6399 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6401 v5 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6402 v6 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6403 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6405 v41 = pBLVRenderParams->fSineY * v6 + pBLVRenderParams->fCosineY * v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6406 v7 = pBLVRenderParams->fSineY * v5 - pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6410 v41 = pBLVRenderParams->fCosineY * v5 - pBLVRenderParams->fSineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6411 v7 = pBLVRenderParams->fSineY * v5 + pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6413 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6414 v9 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6415 v10 = pBLVRenderParams->fCosineNegX * v41 - pBLVRenderParams->fSineNegX * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6416 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417 v12 = pBLVRenderParams->fCosineNegX * v9 + pBLVRenderParams->fSineNegX * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6419 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6421 v42 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6422 v39 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6423 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425 v10 = pBLVRenderParams->fSineY * v39 + pBLVRenderParams->fCosineY * v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 v11 = pBLVRenderParams->fSineY * v42 - pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 v10 = pBLVRenderParams->fCosineY * v42 - pBLVRenderParams->fSineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431 v11 = pBLVRenderParams->fSineY * v42 + pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 v12 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 *(int *)(v3 + 84) = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 v14 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 *(float *)(v3 + 76) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 *(int *)(v3 + 88) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 *(float *)(v3 + 80) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 v3 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6444 while ( v2 < v1->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 v15 = (char *)&this->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 v31 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 v40 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 v32 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 v34 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationY) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 v16 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 LODWORD(v38) = *(int *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 v33 = (double)v16 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 //UNDEF(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 v20 = *((float *)v15 - 1) - (double)pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 if ( v19 | v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 v27 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6465 LODWORD(v35) = *((int *)v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 v28 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 v25 = v33 * v28 + v34 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6468 v26 = v34 * v28 - v33 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 v22 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 v23 = v33 * v22 + v34 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 v24 = *((float *)v15 + 1) - (double)pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6476 v25 = v32 * v24 + v40 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 v26 = v34 * v22 - v33 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 v35 = v40 * v24 - v32 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 *((int *)v15 + 21) = LODWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 v29 = *((int *)v15 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 *((float *)v15 + 19) = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 *((int *)v15 + 22) = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 *((float *)v15 + 20) = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 v15 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 while ( v31 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 v1->field_10 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 //----- (00477F63) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6495 bool stru6_stru1_indoor_sw_billboard::sub_477F63()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 stru6_stru1_indoor_sw_billboard *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 char *v5; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 float v7; // ST08_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 signed int v9; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 float v10; // [sp+10h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 v10 = 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 v3 = (double)pBLVRenderParams->field_40 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 v10 = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 v3 = 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 v4 = a1->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 v5 = (char *)&a1->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 v6 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 if ( v3 >= *(float *)v5 || *(float *)v5 >= (double)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531 if ( v3 < *(float *)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 v5 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 v2->_477927(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 memcpy(&v2->field_14[40], &v2->field_14[20], 16 * v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 _4775ED(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 //----- (0047802A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 int stru6_stru1_indoor_sw_billboard::sub_47802A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 stru6_stru1_indoor_sw_billboard *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 int v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 float v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6564 double v6; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 double v7; // ST30_8@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 double v8; // st6@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6567 double v9; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568 char *v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 float v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6570 double v12; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6571 double v13; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 double v14; // st5@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 signed int v16; // [sp+38h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 int a6; // [sp+3Ch] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 int a5; // [sp+40h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 v4 = (char *)&a1->field_14[42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 LODWORD(v5) = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 v6 = (double)pBLVRenderParams->field_40 * 0.000015258789 / *((float *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 v7 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6595 pGame->pIndoorCameraD3D->Project(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 COERCE_UNSIGNED_INT64(v5 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6597 COERCE_UNSIGNED_INT64(*((float *)v4 - 1) + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6598 COERCE_UNSIGNED_INT64(*(float *)v4 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 &a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601 *((float *)v4 + 18) = (double)a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 *((float *)v4 + 19) = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 *((float *)v4 + 20) = (double)SLODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 *((float *)v4 + 18) = (double)pBLVRenderParams->uViewportCenterX - v6 * *((float *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 v8 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 v9 = v6 * *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 *((int *)v4 + 20) = LODWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 *((float *)v4 + 19) = v8 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 *((int *)v4 + 21) = *((int *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 && (double)(signed int)pViewport->uViewportZ > *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 && (double)(signed int)pViewport->uViewportY <= *((float *)v4 + 19)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 && (double)(signed int)pViewport->uViewportW > *((float *)v4 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 while ( v3 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 v10 = (char *)&a1->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 LODWORD(v11) = *(int *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 v12 = (double)pOutdoorCamera->int_fov_rad / *(float *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 *((float *)v10 + 20) = (double)pViewport->uScreenCenterX - v12 * *((float *)v10 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 v13 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 v14 = v12 * *((float *)v10 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 *((int *)v10 + 22) = LODWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 *((int *)v10 + 23) = *((int *)v10 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 *((float *)v10 + 21) = v13 - v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 && (double)(signed int)pViewport->uViewportZ > *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 && (double)(signed int)pViewport->uViewportY <= *((float *)v10 + 21)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 && (double)(signed int)pViewport->uViewportW > *((float *)v10 + 21) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 v10 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 while ( v1 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 return v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6655
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 //----- (004783FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 void __cdecl sub_4783FA_construct_global_73D150()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 char *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 v0 = (char *)&array_73D150[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 v1 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 *(float *)v0 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667 v0 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6668 --v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 while ( v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6672
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 //----- (0047840D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 char Render::DrawBuildingsD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678 IndoorCameraD3D *v0; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680 Vec3_int_ **v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 Vec3_int_ *v3; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 ODMFace *pFace; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 int v5; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 stru148 *v7; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 LightmapBuilder *v8; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 int v9; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 char v10; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 Texture *pFaceTexture; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 signed int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 unsigned int v13; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 unsigned int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 unsigned int v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 unsigned int v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695 int v17; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696 int v18; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697 char *v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698 char *v20; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6699 Vec3_int_ *v21; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 int v22; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 char *v23; // edi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 int v24; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 int v25; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 int v26; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 int v28; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 double v30; // st7@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 LightmapBuilder *v31; // edi@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 signed int v32; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 int v33; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 unsigned int v34; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 std::string v35; // [sp-18h] [bp-70h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 int v36; // [sp-14h] [bp-6Ch]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 RenderVertexSoft *v37; // [sp-10h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 int v38; // [sp-Ch] [bp-64h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 LightmapBuilder *v39; // [sp-8h] [bp-60h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 int v40; // [sp-4h] [bp-5Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 std::string *v41; // [sp+Ch] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 Vec3_int_ *v42; // [sp+10h] [bp-48h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 LightmapBuilder *pLightmapBuilder; // [sp+14h] [bp-44h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 float v44; // [sp+18h] [bp-40h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 float v45; // [sp+1Ch] [bp-3Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 ODMFace *v46; // [sp+20h] [bp-38h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 IndoorCameraD3D *v47; // [sp+24h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 unsigned int v48; // [sp+28h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 int v49; // [sp+2Ch] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 int v50; // [sp+30h] [bp-28h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 int v51; // [sp+34h] [bp-24h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 int v52; // [sp+38h] [bp-20h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 int v53; // [sp+3Ch] [bp-1Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 Vec3_int_ *v54; // [sp+40h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 int a1; // [sp+44h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 Vec3_int_ **v56; // [sp+48h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 int uNumVertices; // [sp+4Ch] [bp-Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 int unused; // [sp+50h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 int a3; // [sp+57h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 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
6742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 v0 = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 v47 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 result = LOBYTE(pOutdoor->pBModels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6748 v41 = (std::string *)pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6751 v2 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 v56 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 if ( IsBModelVisible(a1, &unused) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 *(v2 - 3) = (Vec3_int_ *)((unsigned int)*(v2 - 3) | 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6759 pFace = (ODMFace *)v2[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 v42 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 if ( (signed int)v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6767 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768 v2 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 v56 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 if ( a1 >= (signed int)v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6775 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6776 if (pFace->Invisible())
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 v5 = (int)*(v2 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 v6 = pFace->pVertexIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 v7 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 v8 = *(LightmapBuilder **)(v5 + 12 * v6 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 *(int *)&v7->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 pLightmapBuilder = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 v9 = pFace->uTextureID;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6786 v10 = (BYTE1(pFace->uAttributes) & 0x40) == 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 v48 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 v48 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 v9 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 pFaceTexture = (Texture *)(v9 != -1 ? (int)&pBitmaps_LOD->pTextures[v9] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 v7->pTexture = pFaceTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 v49 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 v49 = pFaceTexture->uTextureHeight;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6798 v10 = (pFace->uAttributes & 0x10) == 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 v45 = 1.0 / (double)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6800 v44 = 1.0 / (double)v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 *(int *)&v7->flags |= 2u;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6803 if ( BYTE2(pFace->uAttributes) & 0x40 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 HIBYTE(v7->flags) |= 4u;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6805 v13 = pFace->uAttributes;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 if ( v13 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 if ( v13 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 HIBYTE(v7->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 }
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6815 v14 = pFace->uAttributes;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 if ( BYTE1(v14) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 *(int *)&v7->flags |= 0x2000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 if ( v14 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 HIBYTE(v7->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 v15 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 v7->sTextureDeltaU = pFace->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 v7->sTextureDeltaV = pFace->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 v16 = v15 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 if ( pFace->pFacePlane.vNormal.z && (v40 = pFace->pFacePlane.vNormal.z, abs(v40) >= 59082) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 v7->sTextureDeltaV -= v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 v7->sTextureDeltaV += v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6850 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6853 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 if ( BYTE1(v17) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 v7->sTextureDeltaU -= v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6860 if ( BYTE1(v17) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6861 v7->sTextureDeltaU += v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 v18 = pFace->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6864 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 v19 = (char *)&array_73D150[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 v20 = (char *)pFace->pTextureUIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6871 v51 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6874 v21 = &(*(v56 - 1))[*((short *)v20 - 20)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 *((float *)v19 - 2) = (double)v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 *((float *)v19 - 1) = (double)v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 *(float *)v19 = (double)v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6878 v19 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6879 v52 = v7->sTextureDeltaU + *(short *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 *((float *)v19 - 5) = (double)v52 * v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 v22 = v7->sTextureDeltaV + *((short *)v20 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6882 v20 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 v10 = v51-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 v52 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6885 *((float *)v19 - 4) = (double)v22 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 while ( !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6888 v23 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 v51 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 *(float *)&pLightmapBuilder = (double)(signed int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 if ( *(float *)&pLightmapBuilder == *((float *)v23 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 v47->ViewTransform((RenderVertexSoft *)(v23 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 if ( *(float *)v23 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 if ( *(float *)v23 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6900 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6905 v47->Project((RenderVertexSoft *)(v23 - 12), 1u, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 v23 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 --v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 while ( v51 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6911 v18 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 if ( v53 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 LOBYTE(v7->field_32) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6915 v24 = pOutdoor->vSunlight.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 v7->pODMFace = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 v7->uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 v7->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 pLightmapBuilder = (LightmapBuilder *)-v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 v51 = pFace->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 v51 = (unsigned __int64)(-v24 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922 v53 = pFace->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 pLightmapBuilder = (LightmapBuilder *)-pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 v53 = (unsigned __int64)(-pOutdoor->vSunlight.y * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 v52 = pFace->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 v52 = (unsigned __int64)(-pOutdoor->vSunlight.z * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 pLightmapBuilder = (LightmapBuilder *)(v51 + v53 + v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 v51 = 20 * (int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 result = 20 - (20 * (signed int)pLightmapBuilder >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 v7->field_58 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 if ( result < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 v7->field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933 if ( v7->field_58 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 v7->field_58 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 if ( pOutdoorCamera->numStru148s >= 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 if ( ODMFace::IsBackfaceCulled(pFace, array_73D150, v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 LOBYTE(v25) = (char)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 pFace->bVisible = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 v7->uBModelFaceID = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 LOWORD(v25) = (unsigned __int8)v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 v7->uBModelID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 v27 = 8 * (v25 | (v26 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 LOBYTE(v27) = v27 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 v7->field_50 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 v29 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 v30 = 1.0 / (array_73D150[v28].vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 memcpy(&array_50AC10[v28], &array_73D150[v28], sizeof(array_50AC10[v28]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 --v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 array_50A2B0[v28 + 49].flt_20 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 while ( v29 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 pFace = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 static stru154 static_RenderBuildingsD3D_stru_73C834;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 static_RenderBuildingsD3D_byte_73C84C_init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6973 stru154::stru154(&static_RenderBuildingsD3D_stru_73C834);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 atexit(loc_4789D4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 v40 = (int)pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 pLightmapBuilder = pGame->pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979 v31 = pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 pLightmapBuilder->ApplyLights_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 pDecalBuilder->ApplyDecals_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982 v31->std__vector_000004_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 LOBYTE(v31) = 0;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6984 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 if ( pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6990 v40 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 v39 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 v37 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 v36 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 pDecalBuilder->ApplyDecals(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 31 - v7->field_58,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 array_50AC10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 (char)v31,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 }
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7006 if ( stru_F8AD28.uNumLightsApplied > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 pLightmapBuilder->ApplyLights(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 &stru_F8AD28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 array_50AC10,
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
7012 0,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 (char)v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 v32 = sr_424CD7(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7017 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 v32 = sr_424EE0_MakeFanFromTriangle(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 v7->uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 OutdoorCamera::Project(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 if ( uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 v33 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 if ( v33 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 if ( BYTE1(v33) & 0x3C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 v34 = pRenderer->pHDWaterBitmapIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 v34 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 v40 = (int)pBitmaps_LOD->pHardwareTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 v40 = (int)pBitmaps_LOD->pHardwareTextures[v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 pRenderer->DrawPolygon(uNumVertices, v7, pFace, (IDirect3DTexture2 *)v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 v54 = (Vec3_int_ *)((char *)v54 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 v2 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 ++pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 if ( (signed int)v54 >= (signed int)v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 // 73C84C: using guessed type char static_RenderBuildingsD3D_byte_73C84C_init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061 //----- (004789DE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 BSPModel *Render::DrawBuildingsSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 BSPModel *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 unsigned int *v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 int v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 double v8; // st7@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 char *v9; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 double v11; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 stru148 *v12; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7077 double v13; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 double v14; // ST4C_8@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 int v16; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 int v17; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 unsigned __int8 v18; // sf@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 unsigned __int8 v19; // of@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085 int v21; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7086 int v22; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 int v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 int v24; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 Texture *v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 int v26; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 signed int v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 double v28; // st6@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 double v29; // st5@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 int v30; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 int v31; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 double v32; // st4@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 int v33; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 char v34; // zf@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 BSPVertexBuffer *v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 unsigned int v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 signed int v37; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 int v38; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 signed int v39; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 char *v40; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 double v41; // ST1C_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 double v42; // ST24_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 signed int v43; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 signed int v44; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 int v45; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 signed int v46; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 char *v47; // ecx@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 double v48; // ST34_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 double v49; // ST44_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 int v50; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 signed int v51; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 char *v52; // edx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 double v53; // ST3C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 double v54; // ST2C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 float v55; // [sp+44h] [bp-7Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 float v56; // [sp+48h] [bp-78h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 float v57; // [sp+4Ch] [bp-74h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 float v58; // [sp+50h] [bp-70h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 int v59; // [sp+54h] [bp-6Ch]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 int v60; // [sp+58h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 float v61; // [sp+5Ch] [bp-64h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 float v62; // [sp+60h] [bp-60h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 float v63; // [sp+64h] [bp-5Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 float v64; // [sp+68h] [bp-58h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 int v65; // [sp+6Ch] [bp-54h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 int v66; // [sp+70h] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 int v67; // [sp+74h] [bp-4Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 int v68; // [sp+78h] [bp-48h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 int v69; // [sp+7Ch] [bp-44h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 int v70; // [sp+80h] [bp-40h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 int v71; // [sp+84h] [bp-3Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 float v72; // [sp+88h] [bp-38h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 int v73; // [sp+8Ch] [bp-34h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 int v74; // [sp+90h] [bp-30h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 int v75; // [sp+94h] [bp-2Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 int v76; // [sp+98h] [bp-28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 int v77; // [sp+9Ch] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 unsigned int *v78; // [sp+A0h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 int v79; // [sp+A4h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 int a1; // [sp+A8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 int v81; // [sp+ACh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 int v82; // [sp+B0h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 int v83; // [sp+B4h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 signed int v84; // [sp+B8h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 int a2; // [sp+BCh] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 result = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 v66 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 v1 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 v78 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 if ( IsBModelVisible(a1, &a2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 *(v1 - 3) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 v3 = v1[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 v79 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 v68 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7170 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7173 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 v1 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175 result = (BSPModel *)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 v78 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 if ( a1 >= v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 if ( !(*(char *)(v3 + 29) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 v4 = 3 * *(short *)(v3 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 v5 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 v67 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 v6 = *(int *)(*(v1 - 1) + 4 * v4 + 8) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 v83 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7190 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v7 = *(char *)(v3 + 302);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 v77 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 v8 = (double)v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 v9 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 v81 = v3 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 *(float *)&v84 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 v10 = *(int *)(v5 + 4) + 12 * *(short *)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 *((float *)v9 - 3) = (double)*(signed int *)v10 + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 *((float *)v9 - 2) = (double)*(signed int *)(v10 + 4) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 v11 = (double)*(signed int *)(v10 + 8) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 *((float *)v9 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 if ( *(float *)&v84 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 pGame->pIndoorCameraD3D->ViewTransform((RenderVertexSoft *)(v9 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 if ( *(float *)v9 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 if ( *(float *)v9 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 v74 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7220 pGame->pIndoorCameraD3D->Project((RenderVertexSoft *)(v9 - 12), 1u, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 v81 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 v9 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 --v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 v5 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 v7 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 v12 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 *(int *)&v12->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 if ( v82 == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 *(int *)&v12->flags = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 v12->pODMFace = (ODMFace *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 v12->uNumVertices = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 v12->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 v84 = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 v83 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 v82 = -pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 v84 = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 v82 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 v81 = -pOutdoor->vSunlight.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 v84 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 v81 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 v84 = v83 + v82 + ((unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 v13 = (double)v84 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 if ( v13 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 v13 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 *(float *)&v84 = v13 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 v14 = *(float *)&v84 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 v71 = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 v15 = (int)&v12->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 v12->field_58 = 31 - LOBYTE(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 if ( (char)(31 - LOBYTE(v14)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 if ( *(char *)v15 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 *(char *)v15 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 v16 = *(short *)(v3 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 if ( *(char *)(v3 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7261 v16 = pTextureFrameTable->GetFrameTexture(v16, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 v17 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 result = (BSPModel *)&pBitmaps_LOD->pTextures[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7264 v19 = __OFSUB__(pOutdoorCamera->numStru148s, 1999);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 v18 = pOutdoorCamera->numStru148s - 1999 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 if ( !(v18 ^ v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 if ( !ODMFace::IsBackfaceCulled((ODMFace *)v3, array_73D150, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 LOBYTE(v20) = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7280 *(char *)(v3 + 305) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 v12->uBModelFaceID = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 LOWORD(v20) = (unsigned __int8)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 v12->uBModelID = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 v22 = 8 * (v20 | (v21 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 v12->field_50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 if ( *(char *)(v3 + 28) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288 *(int *)&v12->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7289 if ( *(char *)(v3 + 30) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 v23 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 if ( v23 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 if ( v23 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 HIBYTE(v12->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 v24 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 if ( BYTE1(v24) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 HIBYTE(v12->flags) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 if ( v24 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 HIBYTE(v12->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 v25 = v12->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 v27 = v25->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 v84 = v25->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 v28 = 1.0 / (double)v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 v29 = 1.0 / (double)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 if ( v77 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 v30 = v3 + 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 v83 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 v32 = 1.0 / (*(float *)(v31 * 48 + 7590236) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 memcpy(&array_50AC10[v31], &array_73D150[v31], sizeof(array_50AC10[v31]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 array_50A2B0[v31 + 49].flt_20 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 v84 = v12->sTextureDeltaU + *(short *)(v30 - 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 array_50A2B0[v31 + 49].u = (double)v84 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 v33 = v12->sTextureDeltaV + *(short *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 v30 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 v34 = v83-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 v84 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 array_50A2B0[v31 + 49].v = (double)v33 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 while ( !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 v3 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 static stru154 static_sub_004789DE_stru_73C818; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 static_sub_004789DE_byte_73C830__init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 stru154::stru154(&static_sub_004789DE_stru_73C818);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7352 if ( stru_F8AD28.uNumLightsApplied <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 v12->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 v35 = (BSPVertexBuffer *)(v78 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 v12->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7362 v55 = static_sub_004789DE_stru_73C818.face_plane.vNormal.x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7363 v56 = static_sub_004789DE_stru_73C818.face_plane.vNormal.y;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7364 v57 = static_sub_004789DE_stru_73C818.face_plane.vNormal.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369 v36 = sr_4250FE(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 v37 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 if ( !v36 || (OutdoorCamera::Project(v36), v38 = sr_4254D2(v37), (v12->uNumVertices = v38) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 v40 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 LODWORD(v64) = *((int *)v40 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 v41 = v64 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 v69 = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 dword_50B638[v39] = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 LODWORD(v63) = *(int *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 v42 = v63 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 v73 = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 v40 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 dword_50B570[v39++] = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 while ( v39 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 if ( v75 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 v43 = sr_4252E8(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 v44 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 if ( !v43 || (OutdoorCamera::Project(v43), v45 = sr_4254D2(v44), (v12->uNumVertices = v45) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 v47 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 LODWORD(v61) = *((int *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 v48 = v61 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 v65 = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 dword_50B638[v46] = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 LODWORD(v58) = *(int *)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 v49 = v58 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 v59 = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 v47 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 dword_50B570[v46++] = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 while ( v46 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 v50 = sr_4254D2(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 v12->uNumVertices = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 sr_sub_4829B9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 &array_73D150[*(char *)(v3 + 298)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 &array_73D150[*(char *)(v3 + 299)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 &array_73D150[*(char *)(v3 + 300)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 v52 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 LODWORD(v62) = *((int *)v52 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 v53 = v62 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 v60 = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 dword_50B638[v51] = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 LODWORD(v72) = *(int *)v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 v54 = v72 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 v70 = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 v52 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 dword_50B570[v51++] = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 while ( v51 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638, dword_50B570, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 v1 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 v3 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 if ( v79 >= v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 // 73C830: using guessed type char static_sub_004789DE_byte_73C830__init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 //----- (00479089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 BSPModel *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 int v5; // ST28_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 int v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 int v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 signed int v11; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 int v12; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 bool result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 unsigned int v14; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 int v15; // [sp+Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 int *v16; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 int v17; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 int v18; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 int v19; // [sp+20h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 int angle; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 int v21; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 int v22; // [sp+28h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 v16 = unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 angle = (signed int)(pOutdoorCamera->uCameraFovInDegrees << 11) / 360 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 v14 = uModelID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 v2 = &pOutdoor->pBModels[uModelID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 v3 = v2->vBoundingCenter.x - pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500 v4 = v2->vBoundingCenter.y - pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 v5 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 v21 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 v18 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 v17 = v3 * v5 + v4 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 v17 = (unsigned __int64)(v17 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 v19 = v4 * v6 - v3 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 v7 = abs(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 v8 = abs(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 v9 = sub_4621DA(v8, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 v10 = v14 * 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 v22 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 *v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 if ( v9 < pOutdoor->pBModels[v14].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 *v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 v15 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 v11 = ((unsigned __int64)(v15 * (signed __int64)v17) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 - ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 + ((unsigned __int64)(v15 * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 v12 = v11 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 if ( v22 <= pOutdoorCamera->shading_dist_mist + 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v10) + 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 result = v12 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 LOBYTE(result) = v12 >= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 //----- (00479295) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 int stru148::_479295()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551 stru148 *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552 ODMFace *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 int v6; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557 int v7; // ST04_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 stru149 *v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 Vec3_int_ thisa; // [sp+Ch] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 int v11; // [sp+18h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 v2 = this->pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 if ( !v2->pFacePlane.vNormal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 v3 = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567 v4 = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570 v11 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 if ( (v2->pFacePlane.vNormal.x || v2->pFacePlane.vNormal.y) && abs(v2->pFacePlane.vNormal.z) < 59082 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 thisa.x = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576 thisa.y = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 thisa.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 thisa.Normalize_float();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 v4 = thisa.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 v3 = thisa.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 v4 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 v5 = -65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 v6 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 v1->sTextureDeltaU = v2->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 v8 = v1->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 v1->sTextureDeltaV = v2->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 v8->_48616B(v4, v7, 0, 0, v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 //----- (00479332) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 int Render::OnOutdoorRedrawSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 char v3; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 float v5; // ST34_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 double v6; // ST24_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 unsigned int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 signed int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 Vec3_float_ *v10; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 double v11; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 float v12; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 double v13; // ST1C_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 float v14; // [sp+4h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 float v15; // [sp+8h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 float v16; // [sp+Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 v14 = (double)pOutdoor->vSunlight.x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 v1 = (unsigned int)&array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 v15 = (double)pOutdoor->vSunlight.y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 v16 = (double)pOutdoor->vSunlight.z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 if ( v1 > (unsigned int)array_77EC08 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 v2 = (char *)&array_77EC08[0].pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 v3 = v2[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 if ( v3 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 v9 = pTerrainNormalIndices[((*((int *)v2 - 9) >> 15) & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 + 2 * ((unsigned __int8)v2[9] + ((unsigned __int8)v2[8] << 7))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 if ( v9 > (signed int)(uNumTerrainNormals - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 v10 = &pTerrainNormals[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 v11 = -(v16 * v10->z + v15 * v10->y + v14 * v10->x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 if ( v11 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 v11 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 v12 = v11 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 v13 = v12 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 v2[4] = 31 - LOBYTE(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 if ( v2[4] < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 v2 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 if ( (unsigned int)(v2 - 84) >= v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 v4 = (double)(signed int)(((unsigned __int64)(**(int **)v2 * (signed __int64)-pOutdoor->vSunlight.x) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 + ((unsigned __int64)(*(int *)(*(int *)v2 + 4) * (signed __int64)-pOutdoor->vSunlight.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 + ((unsigned __int64)(*(int *)(*(int *)v2 + 8) * (signed __int64)-pOutdoor->vSunlight.z) >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 if ( v4 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 v4 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 v5 = v4 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 v6 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 v7 = (int)(v2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 v2[4] = 31 - LOBYTE(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 if ( (char)(31 - LOBYTE(v6)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 if ( *(char *)v7 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 *(char *)v7 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 if ( *(char *)(*(int *)v2 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 v8 = pTextureFrameTable->GetFrameTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 *((short *)v2 - 4),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 *((int *)v2 - 6) = v8 != -1 ? (int)&pBitmaps_LOD->pTextures[v8] : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 //----- (00479543) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 void Render::DrawSkyD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 double v2; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 double v3; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 double v4; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 double v5; // st4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 double v6; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 char *v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 int v8; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 int v10; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 signed __int64 v11; // qax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 double v12; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 int v13; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 int v14; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 int v15; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 int v16; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 signed __int64 v17; // qtt@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 signed int v18; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 Texture *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 double v20; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 double v21; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 double v22; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 unsigned __int8 v23; // sf@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 unsigned __int8 v24; // of@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 stru148 _this; // [sp+14h] [bp-150h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 double v26; // [sp+120h] [bp-44h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 float v27; // [sp+128h] [bp-3Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 float v28; // [sp+12Ch] [bp-38h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 int v29; // [sp+130h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 int v30; // [sp+134h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 int v31; // [sp+138h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 int v32; // [sp+13Ch] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 int v33; // [sp+140h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 float v34; // [sp+144h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 int v35; // [sp+148h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 double v36; // [sp+14Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 int v37; // [sp+154h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 int v38; // [sp+158h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 int v39; // [sp+15Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 int v40; // [sp+160h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 v30 = (signed __int64)((double)(pOutdoorCamera->int_fov_rad * pIndoorCamera->pos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 / ((double)pOutdoorCamera->int_fov_rad + 8192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 + (double)pViewport->uScreenCenterY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 v34 = cos((double)pIndoorCamera->sRotationX * 0.0030664064) * (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 v38 = (signed __int64)((double)pViewport->uScreenCenterY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 - (double)pOutdoorCamera->int_fov_rad
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 / (v34 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 * (sin((double)pIndoorCamera->sRotationX * 0.0030664064)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 * (double)-pOutdoorCamera->shading_dist_mist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 - (double)pIndoorCamera->pos.z));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 _this._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 _this.ptr_38->_48694B();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 _this.uTileBitmapID = LOWORD(pOutdoor->uSky_TextureID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 _this.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 if ( _this.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 v0 = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 _this.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 _this.uNumVertices = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 _this.v_18.x = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 _this.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 v1 = stru_5C6E00->SinCos(v0 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 v2 = (double)(signed int)pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 _this.v_18.z = -v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 array_50AC10[0].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 v3 = (double)(signed int)pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 array_50AC10[0].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 array_50AC10[1].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 v4 = (double)v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 _this.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 _this.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 v28 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 array_50AC10[1].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 v5 = (double)(signed int)pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 array_50AC10[2].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 v38 = pViewport->uViewportZ - pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 _this.field_24 = 0x2000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771 array_50AC10[2].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 array_50AC10[3].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 array_50AC10[3].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 v6 = tan(0.6457717418670654);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 v33 = 65536 / (signed int)(signed __int64)(v36 / v6 + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 if ( (signed int)_this.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 v7 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 LODWORD(v27) = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 v26 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 v29 = LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 v38 = _this.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 v8 = v39 + _this.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 v39 = v33 * (v30 - LODWORD(v26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 v38 = _this.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 HIDWORD(v36) = v39 + _this.ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 v38 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 v9 = (unsigned __int64)(_this.v_18.z * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 v10 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 v39 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 if ( _this.v_18.x + v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 v11 = (signed __int64)*((float *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 v38 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 v12 = *(float *)v7 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 v13 = v33 * (pViewport->uScreenCenterX - v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 LODWORD(v34) = -_this.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 v32 = (signed __int64)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 v14 = v33 * (v30 - v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 v40 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 v37 = abs(SLODWORD(v34) >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 v15 = abs(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 if ( v37 <= v15 || v32 <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 if ( v39 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 v14 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 v37 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 v14 += v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 v10 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 v39 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 v38 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 LODWORD(v17) = LODWORD(v34) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 HIDWORD(v17) = SLODWORD(v34) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 v40 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 v18 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 if ( v18 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 v18 = pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 v37 = _this.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 v37 = v35 + ((unsigned __int64)(v37 * (signed __int64)v13) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 v35 = _this.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 HIDWORD(v36) += (unsigned __int64)(v35 * (signed __int64)v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 + ((signed int)((unsigned __int64)(v37 * (signed __int64)v18) >> 16) >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 v40 = (unsigned __int64)(SHIDWORD(v36) * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 v19 = _this.pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 HIDWORD(v36) = _this.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 v20 = (double)SHIDWORD(v36) * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 HIDWORD(v36) = 224 * pMiscTimer->uTotalGameTimeElapsed + (v40 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 *((float *)v7 - 10) = (double)v35 / v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 v21 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 HIDWORD(v36) = v19->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 v22 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 HIDWORD(v36) = v18 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 v24 = __OFSUB__(v31, _this.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 v23 = ((v31 - _this.uNumVertices) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 *((float *)v7 - 9) = v21 / (v22 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 *((float *)v7 - 16) = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 *((float *)v7 - 11) = 1.0 / (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 if ( !(v23 ^ v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 array_50AC10[0].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 array_50AC10[3].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 //----- (00479A53) --------------------------------------------------------
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
7886 void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 BLVFace *pFace; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 PolygonType v4; // al@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 signed __int64 v6; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 PolygonType v7; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 int v8; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 int v9; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896 unsigned int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 double v11; // st6@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 int v12; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 char *v14; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 void *v15; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 int v16; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 int v17; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 double v18; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 signed int v19; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 void *v20; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 int v21; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 int v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 signed __int64 v23; // qtt@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 double v24; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 unsigned __int8 v25; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 unsigned __int8 v26; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 Render *v27; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 double v28; // st7@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 char *v29; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 char *v30; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 unsigned __int8 v31; // c0@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 unsigned __int8 v32; // c3@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 double v33; // st6@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 char *v34; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 const void *v35; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 int v36; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 const void *v37; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 signed __int64 v38; // qax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 int v39; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 int v40; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 int v41; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 signed __int64 v42; // qtt@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 int v43; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 char v44; // zf@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 double v45; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 double v46; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 unsigned int v47; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 double v48; // st7@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 RenderVertexSoft *v49; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 void *v50; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 double v51; // st7@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 RenderVertexSoft *v52; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 void *v53; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 char *v54; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 unsigned int v55; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 unsigned int v56; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 int v57; // ST10_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 Texture *v58; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 signed int v59; // [sp-4h] [bp-178h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 stru148 *v60; // [sp+0h] [bp-174h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 stru148 v62; // [sp+14h] [bp-160h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 unsigned int v63; // [sp+120h] [bp-54h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 double v64; // [sp+124h] [bp-50h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 unsigned int v65; // [sp+128h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 unsigned int v66; // [sp+12Ch] [bp-48h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 float v67; // [sp+130h] [bp-44h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 __int64 v68; // [sp+134h] [bp-40h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 __int64 v69; // [sp+13Ch] [bp-38h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 int v70; // [sp+144h] [bp-30h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 int X; // [sp+148h] [bp-2Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 int v72; // [sp+14Ch] [bp-28h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 float v73; // [sp+150h] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 unsigned int v74; // [sp+154h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 RenderVertexSoft *v75; // [sp+158h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 float v76; // [sp+15Ch] [bp-18h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 int v77; // [sp+160h] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 int v78; // [sp+164h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 void *v79; // [sp+168h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 float v80; // [sp+16Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 const void *v81; // [sp+170h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
7969 __debugbreak();
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
7970
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 pFace = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 v65 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 v3 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 v4 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 v54 = (char *)&array_507D30[0].u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 LODWORD(v80) = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 v69 = (GetTickCount() >> 5) - pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 *(float *)v54 = (double)v69 + *(float *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 *(float *)v54 = *(float *)v54 * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 v55 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 v54 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 v44 = LODWORD(v80)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 v68 = pBLVRenderParams->vPartyPos.y + (v55 >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 *((float *)v54 - 11) = ((double)v68 + *((float *)v54 - 11)) * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 uFaceID = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 v56 = 8 * uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 LOBYTE(v56) = 8 * uFaceID | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 v57 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 v58 = pFace->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 pRenderer->DrawIndoorPolygon(v3, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], v58, v57, -1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 HIDWORD(v69) = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 HIDWORD(v68) = pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 v70 = (signed __int64)((double)(pBLVRenderParams->field_40 * pBLVRenderParams->vPartyPos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 / (((double)pBLVRenderParams->field_40 + 16192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 * 65536.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 + *(float *)&v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 v5 = (double)pIndoorCamera->sRotationX * 0.0030664064;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 *(float *)&v75 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 v80 = cos(v5) * 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 v6 = (signed __int64)(*(float *)&v74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 - (double)pBLVRenderParams->field_40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 / ((v80 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 * 65535.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 * (sin(*(float *)&v75) * -16192.0 - (double)SHIDWORD(v68)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 v7 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 if ( v7 == 4 || v7 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 v70 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 v62._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 v62.uTileBitmapID = pFace->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 if ( !v62.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 v8 = pBLVRenderParams->sPartyRotX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 v62.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 v62.uNumVertices = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 v62.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 v62.v_18.x = -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 v62.v_18.z = -stru_5C6E00->SinCos(v8 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 LODWORD(v80) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 v62.field_24 = 33554432;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 v64 = (double)(signed int)v10 * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 LODWORD(v80) = v62.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 v11 = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 LODWORD(v80) = v62.pTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 v12 = v62.pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 v13 = v62.pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 v67 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 *((float *)&v68 + 1) = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 if ( (signed int)v62.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 v59 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 v14 = (char *)&array_507D30[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 v15 = (void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v14));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 LODWORD(v80) = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 v16 = v77 + v62.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 v77 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 v74 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 LODWORD(v80) = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 v79 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 v17 = v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v14 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 v18 = *(float *)v14 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 v19 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 v77 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 X = (int)((char *)v79 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 LODWORD(v76) = (signed __int64)v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 v20 = (void *)(v72 * (v70 - LODWORD(v76)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 v79 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 v21 = abs(v19 >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 if ( v21 <= abs(X) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 v19 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 v20 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 v20 = (char *)v20 + v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 X = v22 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 LODWORD(v23) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 HIDWORD(v23) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 v79 = (void *)(v23 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 LODWORD(v80) = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 LODWORD(v76) = v74 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 LODWORD(v80) = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 v14 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 v81 = (char *)v81 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 v24 = (double)SLODWORD(v80) * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 v26 = __OFSUB__((int)v81, v62.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 *((float *)v14 - 10) = v24 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 *((float *)v14 - 9) = (double)SLODWORD(v80) * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 *((float *)v14 - 11) = 65536.0 / (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 if ( !(v25 ^ v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 LODWORD(v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 v80 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 if ( (signed int)v62.uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 v28 = (double)SLODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 LODWORD(v76) = (int)(char *)array_50AC10 + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 v29 = (char *)&array_50AC10[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 v30 = (char *)&array_507D30[1].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 v79 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 v81 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 v78 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 v31 = v28 < *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 v32 = v28 == *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 memcpy(v79, v81, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 if ( v31 | v32 || v28 >= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 if ( v28 >= *((float *)v30 - 12) || v28 <= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 v33 = (*((float *)v30 - 1) - *((float *)v30 - 13)) * v28 / (*(float *)v30 - *((float *)v30 - 12))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 + *((float *)v30 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 v33 = (*((float *)v30 - 13) - *((float *)v30 - 1)) * v28 / (*((float *)v30 - 12) - *(float *)v30)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 + *((float *)v30 - 13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 *(float *)v29 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 *(unsigned int *)LODWORD(v76) = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 v81 = (char *)v81 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 v30 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 if ( SLODWORD(v73) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 v34 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 v65 = v77 >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 v78 = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 v36 = (int)((char *)v81 + v62.ptr_38->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 v81 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 v74 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 v78 = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 v78 = (int)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 v81 = (const void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 v37 = (const void *)(v72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 v38 = (signed __int64)(*(float *)v34 - 1.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 LODWORD(v76) = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 v39 = v72 * (v70 - v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 v78 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 v40 = abs(X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 if ( abs((signed __int64)v65) <= v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 v39 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 v78 = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 v39 += v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 X = v41 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 v81 = (const void *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 if ( v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 v79 = (void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 v78 = 2 * LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 v81 = (const void *)((unsigned __int64)(v62.v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 * (signed __int64)(signed int)(signed __int64)(((double)v70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 - ((double)(2 * LODWORD(v76))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 - *(float *)v34))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 * (double)v72)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 X = (int)((char *)v81 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 LODWORD(v42) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 HIDWORD(v42) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 v79 = (void *)(v42 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 v81 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 v78 = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 v74 = (unsigned int)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 LODWORD(v76) = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 v78 = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 v74 = (unsigned __int64)(v43 * v42 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 v34 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 v78 = v66 + ((signed int)v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 v44 = HIDWORD(v69)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 v45 = (double)v78 * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 v78 = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v42 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 *((float *)v34 - 10) = v45 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 *((float *)v34 - 9) = (double)v78 * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 v46 = (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 *((float *)v34 - 16) = 0.000015258789 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 *((float *)v34 - 11) = 65536.0 / v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 v48 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 v49 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 if ( v48 >= v49->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 v50 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 ++v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 memcpy(v50, v49, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 --HIDWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 while ( HIDWORD(v69) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 v62.uNumVertices = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 *(float *)&v74 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 v51 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 v52 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 v80 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 if ( v51 <= v52->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 v53 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 memcpy(v53, v52, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 --LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 while ( v80 != 0.0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 v62.uNumVertices = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 v59 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 v27->_4A2ED5(v59, v60, v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 //----- (0047A384) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 void ODM_LoadAndInitialize(const char *pLevelFilename, OutdoorCamera *thisa)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 unsigned int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 MapInfo *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 SpawnPointMM7 *v6; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 size_t v7; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 char *v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 char Source[120]; // [sp+Ch] [bp-84h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 const char *pFilename; // [sp+84h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 unsigned int v12; // [sp+88h] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 int v13; // [sp+8Ch] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 pFilename = pLevelFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 thisa->AllocSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 pWeather->bRenderSnow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 thisa = (OutdoorCamera *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 GetAlertStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 v2 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 v4 = &pMapStats->pInfos[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 v3 = v4->uRespawnIntervalDays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 v4 = (MapInfo *)thisa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 day_attrib &= 0xFFFFFFFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 dword_6BE13C_uCurrentlyLoadedLocationID = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 pOutdoor->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 pFilename,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 (int)&thisa);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 UpdateLayingItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 thisa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 if ( thisa == (OutdoorCamera *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 if ( (signed int)pOutdoor->uNumSpawnPoints > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 v6 = &pOutdoor->pSpawnPoints[v12 / 0x18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 if ( pOutdoor->pSpawnPoints[v12 / 0x18].uKind == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 SpawnEncounter(v4, v6, v5, v5, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 v4->SpawnRandomTreasure(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 v12 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 if ( v13 >= (signed int)pOutdoor->uNumSpawnPoints )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 RespawnGlobalDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 pOutdoor->PrepareDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 pOutdoor->_47F223_LooksLikeGenerateMonsterLoot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 pOutdoor->InitalizeActors(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 pOutdoor->MessWithLUN();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 v7 = strlen("levels\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 strcpy(Source, &pFilename[v7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 strcpy(pOutdoor->pLevelFilename, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 pWeather->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 pIndoorCamera->sRotationY = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 pIndoorCamera->sRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 pOutdoorCamera->RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 pOutdoor->UpdateSunlightVectors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 pOutdoorCamera->int_fov_rad = (signed __int64)pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 pOutdoorCamera->int_fov_rad_inv = (signed __int64)pIndoorCamera->flt_20_inv_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 v8 = (char *)&array_77EC08[0].ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 *(int *)v8 = (int)&stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 v8 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 while ( (signed int)v8 < (signed int)&unk_801A00 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 v9 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 *((int *)v9 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 *(int *)v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 *((int *)v9 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 v9 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 while ( (signed int)v9 < (signed int)&unk_801A0C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 //----- (0047A825) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 bool LevelDecoration::_47A825()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 bool v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 LevelDecoration *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 if ( pParty->uCurrentHour >= 1 || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 178) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 164)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 165)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 166)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 167)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 168)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 169)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 170)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 171)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 172)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 173)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 174)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 175)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 176)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 177) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 LOBYTE(v2->field_2) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 LOBYTE(v2->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 //----- (0047BC6F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 unsigned __int16 *__fastcall GetBillboardPalette(RenderBillboard *a1, int a2, signed int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 int v6; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 signed int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 signed __int64 v9; // qtt@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 signed int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 int v11; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 signed __int64 v12; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 double v13; // ST10_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 int v14; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 signed int v15; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 signed __int64 v16; // qtt@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 signed int v17; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 int v18; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 float a3a; // [sp+20h] [bp+8h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 return PaletteManager::Get(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 if ( !pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 v14 = day_fogrange_1 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 if ( a3 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 if ( a3 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 LODWORD(v16) = (a3 - v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 HIDWORD(v16) = (a3 - v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 v15 = (unsigned __int64)(27 * v16 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 v15 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8504 v17 = _43F55F_get_billboard_light_level(a1, v15);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 if ( v17 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 if ( !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 v7 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 v11 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 if ( a4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 LODWORD(v12) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 HIDWORD(v12) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 a3a = (double)(signed int)(((unsigned __int64)(11 * v12 / (pOutdoorCamera->shading_dist_shade << 16)) >> 16) + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 v13 = a3a + 6.7553994e15;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8521 v10 = _43F55F_get_billboard_light_level(a1, LODWORD(v13) + v11);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 if ( v10 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 if ( v10 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 v10 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 if ( v10 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 v10 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 if ( pWeather->field_FA0 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 v8 = 67108864;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 v8 = pParty->pPartyBuffs[16].uPower << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 if ( a3 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 if ( a3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 LODWORD(v9) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 HIDWORD(v9) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 v6 = (unsigned __int64)(27 * v9 / v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 v6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8549 v10 = _43F55F_get_billboard_light_level(a1, v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 if ( v10 > 27 || !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 //----- (0047BEB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 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
8570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 stru148 *v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 signed int v9; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 int v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 signed int v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 signed int v12; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 signed __int64 v13; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 int *v14; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 int *v15; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 int v16; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 signed __int64 v17; // qtt@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 double v18; // ST10_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 double v19; // ST10_8@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 int v20; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 int result; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 int *v22; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 signed int v23; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 signed __int64 v24; // qtt@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 int v25; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 signed int v26; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 float v27; // [sp+28h] [bp+10h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 float v28; // [sp+28h] [bp+10h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 int v29; // [sp+2Ch] [bp+14h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 v8 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 *(char *)a8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 if ( a1 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 v26 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 v9 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 v10 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 if ( !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 v14 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 v15 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 *a5 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 v16 = v8->field_58 - terrain_gamma;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 if ( v16 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 if ( v16 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 v16 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 v28 = pOutdoor->fFogDensity * 27.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 v19 = v28 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 v29 = LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 LODWORD(v17) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 HIDWORD(v17) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 v27 = (double)(signed int)(((unsigned __int64)(v17 / (pOutdoorCamera->shading_dist_shade << 16) * (31 - *a6)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 + *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 v18 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 v29 = LODWORD(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 *v14 = v16 + v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 v20 = *v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 if ( v16 + v29 > v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 *v14 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 if ( *v14 < v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 *v14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 if ( *v14 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 *v14 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 if ( v9 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 if ( v9 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 v23 = v9 - (day_fogrange_1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 LODWORD(v24) = v23 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 HIDWORD(v24) = v23 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 v25 = (unsigned __int64)(27 * v24 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 *a5 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 if ( v25 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 }
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 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 *v22 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 *a6 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 *v22 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 if ( v10 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 if ( byte_4D864C && BYTE1(pGame->uFlags) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 v11 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 v12 = v11 << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 if ( v9 <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 if ( v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 LODWORD(v13) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 HIDWORD(v13) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 *a5 = (unsigned __int64)(27 * v13 / v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 if ( *a5 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 if ( v8->field_32 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 *(char *)a8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 //----- (0047C178) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 void *__fastcall sr_sub_47C178(signed int a1, stru148 *a2, int terrain_gamma, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770 int v6; // [sp+4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 int v7; // [sp+8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8776 result = PaletteManager::Get(a2->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 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
8781 result = sr_sub_47C1CA(v4, SBYTE3(a4), v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 //----- (0047C1CA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787 void *__fastcall sr_sub_47C1CA(stru148 *a1, char a2, int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791 int v6; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793 int a3a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8801 result = PaletteManager::Get(a1->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 v6 = pGame->_44EC23(a1, &a3a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 if ( v6 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 if ( v6 != -1 || a4 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8812 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 result = PaletteManager::Get_Mist_or_Red_LUT(v7, v6, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8823 result = PaletteManager::Get_Dark_or_Red_LUT(v4->pTexture->palette_id2, v6, a3a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 //----- (0047C24C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 unsigned __int16 *__fastcall sr_sub_47C24C_get_palette(BLVFace *a1, int a2, int a3, char a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 int a3a; // [sp+4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 v5 = pGame->_44ED0A(a1, &a3a, 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 if ( v5 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 a3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 return PaletteManager::Get_Dark_or_Red_LUT(v4, a3, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 //----- (0047C28C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 char *__fastcall sr_sub_47C28C_get_palette(stru148 *a1, char a2, signed int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851 char *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 int a2a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 a2a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8862 result = (char *)pPaletteManager->field_199600_palettes[a1->pTexture->palette_id2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 v6 = pGame->_44EC23(a1, &a2a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 a3 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 if ( a3 != -1 || a4 != -1 )
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8872 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 result = (char *)PaletteManager::_47C30E_get_palette(v7, a2a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8879 result = (char *)PaletteManager::_47C33F_get_palette(v4->pTexture->palette_id2, a2a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 //----- (0047C370) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 unsigned int __cdecl GetLevelFogColor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 signed __int64 v1; // qax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 result = 0xFF258F5Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 if ( pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 v2 = -(pWeather->field_FA0 != 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 result = (v2 & 0xE0E0E1) - 0xE0E0E1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 v1 = (signed __int64)((1.0 - pOutdoor->fFogDensity) * 200.0 + pOutdoor->fFogDensity * 31.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 result = v1 | (((unsigned int)v1 | (((unsigned int)v1 | 0xFFFFFF00) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 }
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 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 //----- (0047C3D7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 double v5; // st7@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929 signed int v6; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 signed int v7; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 double v8; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 double v9; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 double v10; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 float v11; // ST14_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 double v12; // ST08_8@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 v3 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 if ( pParty->field_1613C || !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 return 0xFF000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 v5 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948 if ( a3 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 v8 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 if ( a3 > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957 v7 = (signed __int64)((a3 - v5) / (v8 - v5) * 216.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 v9 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 if ( a3 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 v10 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 if ( a3 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 v11 = (a3 - v9) * 216.0 / (v10 - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 v7 = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 if ( v7 > v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 v7 = 248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 return (-1 - v7) << 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 //----- (0047C4FC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 signed int __fastcall GetActorTintColor(int a1, int a2, float a3, int a4, RenderBillboard *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 signed int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 double v9; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 double v10; // ST0C_8@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 int v11; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 signed int v12; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 double v13; // ST0C_8@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 double v14; // ST0C_8@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 double v15; // st7@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 double v16; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 double v17; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 int v18; // ST14_4@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 double v19; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 signed int v20; // [sp+10h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 float a3a; // [sp+1Ch] [bp+8h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015 float a3b; // [sp+1Ch] [bp+8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016 float a3c; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017 float a3d; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018 float a4b; // [sp+20h] [bp+Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 int a4a; // [sp+20h] [bp+Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 float a4c; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 float a4d; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 int a5a; // [sp+24h] [bp+10h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 return 8 * (31 - a1) | ((8 * (31 - a1) | ((31 - a1) << 11)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 v8 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 return 16711680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 if ( v8 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 v20 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 v9 = (double)v20 * 1024.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 if ( a3 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 if ( a3 > 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 a4b = a3 * 216.0 / v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 v10 = a4b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 v6 = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 if ( SLODWORD(v10) > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 if ( a3 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9060 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9061 if ( a5 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9062 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9063 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9064 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9065 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9067 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9068 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 result = (signed int)0xF8F8F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 v11 = 8 * (a1 - v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 if ( v11 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 if ( v11 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 v12 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 a3b = pOutdoor->fFogDensity * 216.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 v14 = a3b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092 a4a = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096 a3a = (a3 / (double)pOutdoorCamera->shading_dist_shade * 32.0 + 216.0) * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 v13 = a3a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 a4a = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 v6 = a4a + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 if ( a5 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9102 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105 if ( v6 < v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106 v6 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107 if ( v6 > 8 * pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9108 v6 = 8 * pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 if ( !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 v15 = (double)(255 - v6) * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 a3c = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 a4c = v15 * 16.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 v16 = a4c + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 a5a = LODWORD(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 a4d = a3c * 194.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 v17 = a4d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 v18 = LODWORD(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 a3d = a3c * 153.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 v19 = a3d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 result = LODWORD(v19) | ((v18 | (a5a << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 //----- (0047F44B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 int __stdcall WorldPosToGridCellX(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 return (a1 >> 9) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 //----- (0047F458) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 int __stdcall WorldPosToGridCellZ(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 return 64 - (a1 >> 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 //----- (0047F469) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 int __stdcall GridCellToWorldPosX(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 return (a1 - 64) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149 // 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 //----- (0047F476) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 int __stdcall GridCellToWorldPosZ(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 return (64 - a1) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 // 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 //----- (0047F4D3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 void __fastcall sub_47F4D3(int band1, int band2, int band3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 stru220 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163 double v5; // ST2C_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 double v6; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 double v7; // [sp+18h] [bp-28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 double v8; // [sp+20h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 int v9; // [sp+34h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 int v10; // [sp+38h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 signed int band3a; // [sp+48h] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 v9 = band2 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 pOutdoorCamera->outdoor_grid_band_3 = band3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 v10 = band1 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 v3 = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 pOutdoorCamera->uPickDepth = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 v4 = stru_76E5C8; // v4: 0 -> 65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 band3a = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 v8 = (double)(signed int)((char *)v4 + 256 - (int)stru_76E5C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 do // band3a: 0 -> 128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 v5 = pow((double)band3a, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 v6 = pow(v8, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 *((float *)&v5 + 1) = sqrt(v6 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 v7 = *((float *)&v5 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 if ( SLODWORD(v7) >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 if ( SLODWORD(v7) >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 v4->field_0 = ((SLODWORD(v7) >= v3) - 1) & 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 v4->field_0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 v4->field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 band3a += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 v4->distance = LOWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 while ( band3a < 65792 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 while ( (signed int)v4 < (signed int)arary_77E5C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 //----- (004811A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 void stru148::_4811A3()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 pBitmaps_LOD->pHardwareTextures[pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid]],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 pBitmaps_LOD->pHardwareTextures[uTileBitmapID],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 //----- (00481DB2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 char __fastcall sr_sub_481DB2(RenderVertexSoft *a1, signed int a2, stru148 *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 signed int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 char *v6; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 double v7; // ST14_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 double v8; // ST0C_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 char result; // al@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 if ( a2 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 v3 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 v4 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 a3->ptr_38 = &stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 a3->pTexture = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 if ( (signed int)a3->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246 v6 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 v7 = *((float *)v6 - 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 dword_50B638[v5] = LODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 v8 = *(float *)v6 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 dword_50B570[v5++] = LODWORD(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 while ( v5 < (signed int)a3->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 result = sr_sub_486B4E_push_outdoor_edges(a1, dword_50B638, dword_50B570, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 //----- (00481E55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 void OutdoorCamera::Project(unsigned int uNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 double v1; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 double v2; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 double v3; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 unsigned int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 double v6; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 double v7; // st3@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 v1 = (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 v2 = (double)pViewport->uScreenCenterX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 v3 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 v5 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286 v6 = v1 * array_507D30[v4].flt_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 v7 = v6 * array_507D30[v4].vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 memcpy(&array_50AC10[v4], &array_507D30[v4], sizeof(array_50AC10[v4]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 array_50AC10[v4].vWorldViewProjX = v2 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 array_50AC10[v4].vWorldViewProjY = v3 - v6 * array_507D30[v4].vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 //----- (00481EB7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 void __cdecl ResetStru148s()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 int v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 v0 = pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 if ( pOutdoorCamera->numStru148s > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 v1 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 *((int *)v1 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 *(int *)v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 *((int *)v1 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 v1 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 while ( v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 //----- (00481ED9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 void __cdecl sub_481ED9_MessWithOutdoorCamera()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324 pOutdoorCamera->numStru148s = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 pOutdoorCamera->uNumEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 pOutdoorCamera->uNumSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 pOutdoorCamera->uNumSurfs = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9328 pOutdoorCamera->uNumBillboards = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 pOutdoorCamera->field_44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 //----- (00481EFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 RenderVertexSoft *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 RenderVertexSoft *v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 bool v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 bool v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 bool v9; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340 bool v10; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 double v11; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 signed int v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 signed int v13; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 signed int v14; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 signed int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 RenderVertexSoft *v17; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 v6 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 v17 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 v7 = a1->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 v8 = v5->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 v9 = a3->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 v10 = a4->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 return !(v8 & v9 & v10 & v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 && ((v11 = (double)pOutdoorCamera->shading_dist_mist, v11 > v6->vWorldViewPosition.x) ? (v12 = 0) : (v12 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 v11 > v17->vWorldViewPosition.x ? (v13 = 0) : (v13 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 v11 > a3->vWorldViewPosition.x ? (v14 = 0) : (v14 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 v11 > a4->vWorldViewPosition.x ? (v15 = 0) : (v15 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 !(v13 & v14 & v15 & v12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 //----- (00481FC9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 int __fastcall sub_481FC9(RenderVertexSoft *_ECX, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 /*signed int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 __int64 v11; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 __int64 v12; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 __int64 v13; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 __int64 v14; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 __asm { fld dword ptr [ecx+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 _ESI = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 _EDX = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 __asm { fcomp dword ptr [esi+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 _EDI = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 __asm { fnstsw ax }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 fld dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 fcomp dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 *(int *)&a4->flags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 fld dword ptr [ecx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 fstp [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 fld dword ptr [ecx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 fstp [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 fld dword ptr [ecx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 fstp [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 fld dword ptr [edx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 fstp [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 fld dword ptr [edx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 fstp [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 fld dword ptr [edx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 fstp [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 fld dword ptr [ecx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 fld dword ptr [ecx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 fld dword ptr [ecx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 fld dword ptr [edx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 fld dword ptr [edx+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 [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 fld st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 fild pIndoorCamera->pos.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 fmul st, st(6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 fld st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 fild pIndoorCamera->pos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 fmul st, st(7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 fild pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 fcomp ds:flt_4D84E8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 if ( __SETP__(HIBYTE(_AX) & 0x41, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 _EDI->v_18.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 _EDI->v_18.y = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 _EDI->v_18.z = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 stru148::_486089_normalize_v_18(_EDI);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 fild dword ptr [edi+18h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 fmul dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 fchs
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 fild dword ptr [edi+1Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 fmul dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 fild dword ptr [edi+20h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 fmul dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 _EDI->field_24 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 //----- (004823F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 bool __fastcall GetTerrainHeightsAroundParty(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 unsigned int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 int v6; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 int v9; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 int v11; // [sp+14h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 int v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 v12 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 v2 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 v3 = WorldPosToGridCellZ(v11) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 dword_76D568_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 dword_76D56C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 dword_76D570_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 dword_76D574_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 dword_76D558_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 dword_76D55C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 dword_76D560_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 dword_76D564_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 dword_76D548_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 dword_76D54C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 dword_76D550_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 v4 = pOutdoor->DoGetHeightOnTerrain(v2, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 dword_76D554_terrain_cell_world_pos_around_party_y = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 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
9560 && 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
9561 && dword_76D550_terrain_cell_world_pos_around_party_y == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 v6 = abs(v12 - dword_76D568_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 if ( abs(dword_76D558_terrain_cell_world_pos_around_party_z - v11) >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 v7 = dword_76D554_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 v8 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 v9 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 v7 = dword_76D54C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 v8 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 v9 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 if ( v8 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 if ( v7 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 v10 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 if ( v7 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 if ( v8 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 if ( v7 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 return v9 - v10 > 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 //----- (0048257A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 unsigned int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 unsigned int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 int v7; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 int v8; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 int v9; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 int v11; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 int v12; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 int v13; // [sp+10h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 signed int v14; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 int v15; // [sp+24h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 v11 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 v12 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 v4 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 v5 = WorldPosToGridCellZ(v12) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 dword_76D538_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624 dword_76D53C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 dword_76D540_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 dword_76D544_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 dword_76D528_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 dword_76D52C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 dword_76D530_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 dword_76D534_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 dword_76D518_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 dword_76D51C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 dword_76D520_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 dword_76D524_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 *a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 if ( pOutdoor->ActuallyGetSomeOtherTileInfo(v4, v5) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 *a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 if ( !a4 && *a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 v14 = -60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 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
9642 || 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
9643 || 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
9644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 v7 = abs(v11 - dword_76D538_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 if ( abs(dword_76D528_terrain_cell_world_pos_around_party_z - v12) >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 v8 = dword_76D524_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 v9 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 v10 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 v15 = v11 - dword_76D544_terrain_cell_world_pos_around_party_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 v13 = v12 - dword_76D534_terrain_cell_world_pos_around_party_z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 v8 = dword_76D51C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 v9 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 v10 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 v15 = dword_76D53C_terrain_cell_world_pos_around_party_x - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 v13 = dword_76D52C_terrain_cell_world_pos_around_party_z - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 result = v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 + ((unsigned __int64)(v13 * (signed __int64)((v10 - v8) << 7)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 + ((unsigned __int64)(v15 * (signed __int64)((v9 - v8) << 7)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 result = v14 + dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 //----- (0048276F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 void stru148::_48276F_sr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 float v2; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 char *v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 float v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 float v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 float v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 float v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 int i; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 int v10; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 RenderVertexSoft *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 RenderVertexSoft *v12; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 RenderVertexSoft *v13; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 int v14; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 RenderVertexSoft *v15; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 double v16; // st6@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 double v17; // st5@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695 double v18; // st4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 int v19; // [sp+4h] [bp-2Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 int v20; // [sp+8h] [bp-28h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 int v21; // [sp+Ch] [bp-24h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 stru148 *v22; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 float v23; // [sp+14h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 float v24; // [sp+18h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 float v25; // [sp+1Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 float v26; // [sp+20h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 float v27; // [sp+24h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 float v28; // [sp+28h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 float v29; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 v1 = this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 v22 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 if ( (signed int)v1 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 LODWORD(v2) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 v26 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 v28 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 v3 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 v27 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 if ( (signed int)v1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 v4 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 if ( *((float *)v4 - 1) < (double)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 LODWORD(v5) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 v25 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 v26 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 if ( *((float *)v4 - 1) > (double)v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 LODWORD(v6) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 v27 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 if ( *(float *)v4 < (double)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 LODWORD(v7) = *(int *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v29 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 v28 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 if ( v3 < *(float *)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 v3 = *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 v23 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 ++LODWORD(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 v4 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 while ( SLODWORD(v2) < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 v8 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 if ( LODWORD(v29) == LODWORD(v25) || LODWORD(v29) == LODWORD(v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 v8 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 v29 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 for ( i = 0; i < (signed int)v1; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 if ( i == LODWORD(v25) || i == LODWORD(v24) || i == LODWORD(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v10 = LODWORD(v29)++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 *(&v19 + v10) = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 v11 = &array_508690[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 v12 = &array_508690[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 v13 = &array_508690[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 if ( LODWORD(v29) != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 v11 = array_508690;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 v13 = (RenderVertexSoft *)((char *)array_508690 + 16 * (3 * v1 - 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 v12 = &array_508690[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 v28 = array_508690[1].vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 v27 = array_508690[1].vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 v29 = array_508690[1].vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v26 = v13->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 v25 = v13->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 v24 = v13->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 if ( v24 * v27 - v25 * v29 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 if ( v26 * v29 - v24 * v28 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 if ( v25 * v28 - v26 * v27 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 v14 = v1 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 LODWORD(v26) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 if ( v14 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 v15 = &array_508690[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 v16 = v15->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 v17 = v15->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 v18 = v15->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 v13 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 if ( v27 * v18 - v17 * v29 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 if ( v16 * v29 - v18 * v28 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 if ( v28 * v17 - v16 * v27 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 --LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 --v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 while ( SLODWORD(v26) >= 2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 sr_sub_4829B9(v11, v12, v13, v22, 1);
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 //----- (004829B9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 stru148 *__fastcall sr_sub_4829B9(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 double v5; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 RenderVertexSoft *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 double v7; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 stru148 *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 double v9; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 double v10; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 float v11; // ST0C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 float v12; // ST04_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 double v13; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 float v14; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 float v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 float v16; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 float v17; // [sp+1Ch] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 v5 = a2->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 v16 = a3->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 v15 = a2->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 v14 = v6->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 v7 = v16 * v5 - v14 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 v7 = 0.0000001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 v9 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 v10 = 1.0 / a1->vWorldViewPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 v11 = 1.0 / a2->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 v12 = 1.0 / v6->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 v13 = (v11 * v16 - v12 * v15) * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 v17 = (v11 * v14 - v12 * v5) * -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 a4->field_C = a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 a4->field_10 = a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 a4->field_0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 a4->field_8 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 a4->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 //----- (00482A90) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 signed int __cdecl const_1_0()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 //----- (00482A94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 int sr_sub_482A94(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 signed int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 int v14; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 signed __int64 v15; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 stru149 *v16; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 signed int v17; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 Texture *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 unsigned __int16 *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 stru149 *v20; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 signed int v21; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 int v22; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 Texture *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 signed int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 signed int v27; // [sp-4h] [bp-A4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 int v28; // [sp+Ch] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 int v29; // [sp+10h] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 stru316 a2; // [sp+14h] [bp-8Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 stru315 a1; // [sp+3Ch] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 int v32; // [sp+80h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 int v33; // [sp+84h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 int v34; // [sp+88h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 int v35; // [sp+8Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 int v36; // [sp+90h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 int v37; // [sp+94h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 int v38; // [sp+98h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 int X; // [sp+9Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 v37 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 v7 = v38 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 v37 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 v8 = ((unsigned __int64)(v37 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 v37 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 v9 = v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 v28 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 v35 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 v10 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 v29 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 v32 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 v11 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 v37 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 v12 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 v13 = -v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 v36 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 X = ((unsigned __int64)(v37 * (signed __int64)v12) >> 16) + v38 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 if ( !X || (v14 = abs(v13 >> 14), v14 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 LODWORD(v15) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 HIDWORD(v15) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 v38 = v15 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 v16 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 v36 = v16->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 v36 = v33 + ((unsigned __int64)(v36 * (signed __int64)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 v33 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 X = (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 v34 += (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 if ( v38 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 if ( v38 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 if ( v38 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 v27 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 v27 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 v17 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 if ( v17 < (signed int)v3->ptr_48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 v17 = (signed int)v3->ptr_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 v18 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 v19 = (unsigned __int16 *)v18->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 if ( v17 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 v19 = (unsigned __int16 *)v18->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 v19 = (unsigned __int16 *)v18->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 v19 = (unsigned __int16 *)v18->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 a1.pTextureLOD = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 X = (unsigned __int64)(v36 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 v20 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 X = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 a1.field_30 = v28 + ((unsigned __int64)(v36 * (signed __int64)v38) >> 16) - v20->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 X = (unsigned __int64)(v34 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 v21 = X - v3->ptr_38->field_28 - v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 a1.field_30 >>= v17 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 a1.field_2C = v21 >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 v35 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 v37 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v38) >> 16) >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 a1.field_4 = (unsigned __int64)(v37 * (signed __int64)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 X = (unsigned __int64)(v37 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 a1.field_0 = -(signed int)((unsigned __int64)(v37 * (signed __int64)v32) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 v22 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 a1.pColorBuffer = &pRenderer->pTargetSurface[v2->field_8 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 HIWORD(v23) = HIWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v2->field_8 + 640 * v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 LOWORD(v23) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 a1.field_24 = v23 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 v32 = (signed int)v24->uTextureWidth >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 v25 = (signed int)v24->uTextureHeight >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 a1.field_10 = v17 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 a1.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 a1.field_8 = (v25 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 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
10017 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 //----- (00482E07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 signed int __fastcall sr_sub_482E07(Span *ecx0, unsigned __int16 *pRenderTarget)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 stru149 *v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 int v8; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 int v10; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 unsigned __int64 v12; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 signed __int64 v14; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 int v15; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 signed __int64 v16; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 int v17; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 unsigned __int16 *v18; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 Texture *v19; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 Texture *v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 Texture *v21; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 Texture *v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 int v23; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 Texture *v24; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 signed int v25; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 signed int v26; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 char v27; // bl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 stru149 *v28; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 stru149 *v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 int v30; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 int v31; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 unsigned int v32; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 int v33; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 signed __int64 v34; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 signed int v35; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 int v36; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 stru149 *v37; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 int v38; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 int v39; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 int v40; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 signed __int64 v41; // qtt@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 int v42; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 stru149 *v43; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 int v44; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 int v45; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 Span *v46; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 stru149 *v47; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 stru149 *v48; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 int v49; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 int v50; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 unsigned int v51; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 int v52; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 signed __int64 v53; // qtt@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 unsigned int v54; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 int v55; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 stru149 *v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 int v57; // edi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 int v58; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 int v59; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 signed __int64 v60; // qtt@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 int v61; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 stru149 *v62; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 int v63; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 int v64; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 int v66; // [sp+Ch] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 int v67; // [sp+10h] [bp-B4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092 int v68; // [sp+14h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 int v69; // [sp+18h] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 int v70; // [sp+1Ch] [bp-A8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 int v71; // [sp+20h] [bp-A4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 signed int v72; // [sp+24h] [bp-A0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 stru316 a2; // [sp+28h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 int v74; // [sp+50h] [bp-74h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 stru315 a1; // [sp+54h] [bp-70h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 Span *v76; // [sp+98h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 unsigned __int16 *v77; // [sp+9Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 int v78; // [sp+A0h] [bp-24h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 int v79; // [sp+A4h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 int v80; // [sp+A8h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 int v81; // [sp+ACh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 int X; // [sp+B0h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 int v83; // [sp+B4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 int v84; // [sp+B8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 int v85; // [sp+BCh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 int v86; // [sp+C0h] [bp-4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 v85 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 v3 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 v4 = pViewport->uScreenCenterY - ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 v77 = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 v5 = pOutdoorCamera->int_fov_rad_inv * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 v76 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 v83 = v6->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 v7 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 v8 = v81 + v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 v83 = v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 v67 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 v9 = ((unsigned __int64)(v83 * (signed __int64)v5) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 v71 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 v83 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 v68 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 v69 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 v72 = -v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 v10 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - ecx0->field_8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 v11 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 v66 = v81 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 v83 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 v12 = v10 * (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v81 = v12 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 v13 = v66 + (v12 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 v84 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 if ( !v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 || (X = v72 >> 15, v83 = abs(v13), abs(v72 >> 15) >= v83)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 || (LODWORD(v14) = v72 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 HIDWORD(v14) = v72 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 v79 = v14 / v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 v80 = v10 - v85 * pOutdoorCamera->int_fov_rad_inv,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 v81 = (unsigned __int64)(v80 * (signed __int64)v3->v_18.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 (v84 = v66 + v81) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 || (v15 = abs(v66 + v81), abs(X) >= v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 LODWORD(v16) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 HIDWORD(v16) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 v70 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 v17 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 a1.field_24 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 if ( v79 >= v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 a1.field_24 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 v18 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 if ( a1.field_24 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 if ( a1.field_24 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 if ( a1.field_24 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 v84 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 v18 = (unsigned __int16 *)v22->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 v21 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 v18 = (unsigned __int16 *)v21->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 v18 = (unsigned __int16 *)v20->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 v19 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 v18 = (unsigned __int16 *)v19->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 a1.pTextureLOD = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 v23 = v3->field_5A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 v83 = v3->field_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 v74 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 v78 = v85 >> v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 v25 = v24->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 v81 = v85 - (v85 >> v23 << v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 v26 = (signed int)v24->uTextureHeight >> v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 a1.field_10 = v84 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 v27 = v84 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 a1.field_8 = (v26 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 a1.field_C = (v25 >> v84) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 if ( v79 >= v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 v46 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 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
10214 v47 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 v86 = v47->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 v79 = (unsigned __int64)(v84 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 v48 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 v79 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v70) >> 16) - v48->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 v79 = (unsigned __int64)(v86 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 v49 = ((unsigned __int64)(v86 * (signed __int64)v70) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 a1.field_2C = (v69 + v49) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 v50 = v46->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 v51 = v50 + pRenderer->uTargetSurfacePitch * v46->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 a1.pDepthBuffer = (unsigned int *)(&pRenderer->pActiveZBuffer[640 * v46->field_A - 1] + v85 + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 a1.pColorBuffer = &v77[v85 - 1] + v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 v77 = (unsigned __int16 *)v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 v84 = v66 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 if ( v66 + (unsigned int)((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 && (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
10247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 LODWORD(v53) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 HIDWORD(v53) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 v86 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 v54 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 v84 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 v84 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 v54 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 HIWORD(v55) = HIWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 LOWORD(v55) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 a1.field_24 = v3->field_50 | v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 v77 = (unsigned __int16 *)v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 v77 = (unsigned __int16 *)(v67 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 v56 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 v57 = ((unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16) - v56->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 v77 = (unsigned __int16 *)v56->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 v77 = (unsigned __int16 *)(v71 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 v58 = (((v69 + v86 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 a1.field_4 = (((v68 + v57) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 a1.field_0 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 v86 = (unsigned __int64)(v83 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 v59 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 if ( abs(X) < v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 LODWORD(v60) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 HIDWORD(v60) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 v86 = v60 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 HIWORD(v61) = (unsigned int)(v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 LOWORD(v61) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 a1.field_24 = v61 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 v62 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 v63 = ((unsigned __int64)(v83 * v60 / v84) >> 16) - v62->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 v83 = v62->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 v64 = (((signed int)(v69 + ((unsigned __int64)(v83 * v60 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 a1.field_4 = (((v68 + v63) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 a1.field_0 = v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 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
10351 v28 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 v86 = v28->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 v85 = (unsigned __int64)(v84 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 v29 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 v85 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v79) >> 16) - v29->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 v85 = (unsigned __int64)(v86 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 v30 = ((unsigned __int64)(v86 * (signed __int64)v79) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 a1.field_2C = (v69 + v30) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 v31 = v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 v32 = pRenderer->uTargetSurfacePitch * v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 v86 = v76->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 a1.pColorBuffer = &v77[v86 + v32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v86 + 640 * v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 v80 = v10 - (pOutdoorCamera->int_fov_rad_inv << v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 v86 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 v78 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 v85 = (unsigned __int64)(v78 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 v84 = v66 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 if ( v66 + (unsigned int)((unsigned __int64)(v78 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 && (v33 = abs((signed __int64)v66 + ((__int64)(v78 * (signed __int64)v80) >> 16)), abs((signed __int64)X) < v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 LODWORD(v34) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 HIDWORD(v34) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 v85 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 v35 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 v84 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 v84 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 v35 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 HIWORD(v36) = HIWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 LOWORD(v36) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 a1.field_24 = v3->field_50 | v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 v78 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 v78 = v67 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 v37 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 v38 = ((unsigned __int64)(v78 * (signed __int64)v35) >> 16) - v37->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 v78 = v37->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 v78 = v71 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 v39 = (((v69 + v85 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 a1.field_4 = (((v68 + v38) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 a1.field_0 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 v80 -= pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 --v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 while ( v86 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 v76 = (Span *)((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 v40 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 if ( abs(X) < v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 LODWORD(v41) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 HIDWORD(v41) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 X = v41 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 HIWORD(v42) = (unsigned int)(v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 LOWORD(v42) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 a1.field_24 = v42 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 v43 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 v44 = ((unsigned __int64)(v83 * v41 / v84) >> 16) - v43->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 v83 = v43->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 v45 = (((signed int)(v69 + ((unsigned __int64)(v83 * v41 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 a1.field_4 = (((v68 + v44) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 a1.field_0 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 //----- (004839BD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 signed int __fastcall sr_sub_4839BD(Span *ecx0, unsigned __int16 *pTargetSurface)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 unsigned int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 stru149 *v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 int v12; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 int v14; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 int v16; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 signed int v17; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 int v18; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 signed __int64 v19; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 int v20; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 unsigned __int16 *v21; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 Texture *v22; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 Texture *v23; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 Texture *v24; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 Texture *v25; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 int v27; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 signed int v28; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 Texture *v29; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 int v30; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 signed int v31; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 signed int v32; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 int v34; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 int v35; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 int v36; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 int v37; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 signed __int64 v38; // qtt@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 int v39; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 int v40; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 stru149 *v41; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 int v42; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 int v43; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 int v44; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 char v45; // zf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 int v46; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 int v47; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 int v48; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 int v49; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 signed __int64 v50; // qtt@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 int v51; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 int v52; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 int v53; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 stru149 *v54; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 int v55; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 signed int v56; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 int v57; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 unsigned __int64 v58; // qax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 int v60; // [sp+Ch] [bp-BCh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 Span *v61; // [sp+10h] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 int v62; // [sp+14h] [bp-B4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 int v63; // [sp+18h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 stru315 a1; // [sp+1Ch] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 stru316 a2; // [sp+60h] [bp-68h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 int v66; // [sp+88h] [bp-40h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 int v67; // [sp+8Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 int v68; // [sp+90h] [bp-38h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 int v69; // [sp+94h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 int v70; // [sp+98h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 int v71; // [sp+9Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 int v72; // [sp+A0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 int v73; // [sp+A4h] [bp-24h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 int v74; // [sp+A8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 int v75; // [sp+ACh] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 int v76; // [sp+B0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 int v77; // [sp+B4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 int X; // [sp+B8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 int v79; // [sp+BCh] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 int v80; // [sp+C0h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 unsigned int v81; // [sp+C4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 v3 = ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 v4 = ecx0->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 v5 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 v6 = v4 + pRenderer->uTargetSurfacePitch * ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 v61 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 v7 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 a1.pColorBuffer = &pTargetSurface[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 v74 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v4 + 640 * v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 v9 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 v10 = v5->ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 v76 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 v72 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 v81 = (unsigned __int64)(v10 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 v11 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 v12 = v81 + v11->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 v72 = v11->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 v67 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 v13 = ((unsigned __int64)(v72 * (signed __int64)v9) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 v81 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 v70 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 v72 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 v81 = (unsigned __int64)(v72 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 v14 = v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 v15 = v81 + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 v71 = v5->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 v63 = v5->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 v16 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 v17 = -v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 v60 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 v81 = (unsigned __int64)(v76 * (signed __int64)v16) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 X = v81 + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 if ( !(v81 + v15) || (v62 = v17 >> 14, v18 = abs(v17 >> 14), v18 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 LODWORD(v19) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 HIDWORD(v19) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 v69 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 v20 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 v21 = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 a1.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 if ( v20 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 if ( v20 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 if ( v20 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 v25 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 v75 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 v21 = (unsigned __int16 *)v25->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 v21 = (unsigned __int16 *)v24->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 v21 = (unsigned __int16 *)v23->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 v21 = (unsigned __int16 *)v22->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 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
10662 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 v66 = v74 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 v72 = v74 - 16 * (v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 v76 = v26->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 v74 = v67 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 v76 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 v76 = v70 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 v81 = (unsigned __int64)(v74 * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 v27 = ((unsigned __int64)(v74 * (signed __int64)v20) >> 16) - v5->ptr_38->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 v81 = (unsigned __int64)(v76 * (signed __int64)v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 v28 = v63 + ((unsigned __int64)(v76 * (signed __int64)v69) >> 16) - v5->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 v76 = v75 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 v73 = v8 - 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 v30 = (v71 + v27) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 v31 = v28 >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 v32 = (signed int)v29->uTextureWidth >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 v74 = (signed __int16)v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 v68 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 v80 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 v33 = (signed int)v29->uTextureHeight >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 v34 = v75 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 a1.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 v81 = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 a1.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 a1.field_C = v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 if ( v66 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 v74 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 v80 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 v35 = (unsigned __int64)(v80 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 v36 = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 X = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 if ( v35 + v60 && (v80 = abs(v62), v37 = abs(v36), v80 <= v37) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 LODWORD(v38) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 HIDWORD(v38) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 v80 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 v39 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 X = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 X = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 v39 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 HIWORD(v40) = HIWORD(v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 if ( v39 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 HIWORD(v40) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 LOWORD(v40) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 a1.field_24 = v5->field_50 | v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 v41 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 v42 = ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v41->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 v79 = v41->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 v79 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 v43 = (v71 + v42) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 v79 = (signed int)(v63 + ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 a1.field_4 = (v43 - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 a1.field_0 = (v79 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v68 >> v66));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 v44 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 a1.field_2C = v68 + 4 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 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
10739 v73 -= 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 v45 = v74-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 v30 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 while ( !v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 v31 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 if ( !v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v31 >> (12 - v75)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 v46 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 a1.field_2C = v68 + 4 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 v79 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 v80 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 v47 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 v48 = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 X = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 if ( v47 + v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 v79 = abs(v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 v49 = abs(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 if ( v79 <= v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 LODWORD(v50) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 HIDWORD(v50) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 v77 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 v51 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 HIWORD(v52) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 if ( v51 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 LOWORD(v52) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 a1.field_24 = v52 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 HIWORD(v53) = HIWORD(v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 LOWORD(v53) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 a1.field_24 = v53 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 v77 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 v67 = (unsigned __int64)(v79 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 v54 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 v55 = v67 - v54->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 v79 = v54->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 v56 = v71 + v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 v71 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 v57 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 v79 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 v58 = v57 * (signed __int64)v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 v70 = v58 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 LODWORD(v58) = (signed int)(v63 + (v58 >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 a1.field_4 = ((v56 >> v76) - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 a1.field_0 = ((signed int)v58 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 a1.field_28 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 //----- (0048408A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 signed int sr_sub_48408A_prolly_odm_water_no_waves(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 int v14; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 signed int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 int v16; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 stru149 *v18; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 int v19; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 Texture *v20; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 Texture *v23; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 stru149 *v25; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 signed int v26; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 int v27; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 int v28; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 int v29; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 int v30; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 Texture *v31; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 int v32; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 int v33; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 int v35; // [sp+Ch] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 int v36; // [sp+10h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 stru316 a2; // [sp+14h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 stru315 a1; // [sp+3Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 int v39; // [sp+80h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 int v40; // [sp+84h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 int v41; // [sp+88h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 int v42; // [sp+8Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 int v43; // [sp+90h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 int v44; // [sp+94h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 v42 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 v7 = v44 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 v42 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 v39 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 v8 = ((unsigned __int64)(v42 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 v42 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 v9 = v44 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 v36 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 v42 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 v14 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 v15 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 v40 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 v16 = ((unsigned __int64)(v42 * (signed __int64)v14) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 v44 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 if ( !v16 || (v43 = abs(v15 >> 14), v43 > abs(v16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 LODWORD(v17) = v40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 HIDWORD(v17) = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v43 = v17 / v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 v18 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 v40 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 v40 = v39 + ((unsigned __int64)(v40 * (signed __int64)v42) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 v39 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 v44 = (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 v19 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 v41 += (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 if ( v43 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 v21 = (unsigned __int16 *)v20->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 if ( v43 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 v21 = (unsigned __int16 *)v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 if ( v43 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 v44 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 v21 = (unsigned __int16 *)v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 v23 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 a1.pTextureLOD = (unsigned __int16 *)v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 v43 = (unsigned __int64)(v40 * (signed __int64)v43) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 v25 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 v43 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 a1.field_30 = ((unsigned __int64)(v40 * (signed __int64)v19) >> 16) - v25->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 v43 = (unsigned __int64)(v41 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 v26 = ((unsigned __int64)(v41 * (signed __int64)v19) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 v27 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 v41 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 a1.field_2C = v26 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 v41 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 v42 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v19) >> 16) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 a1.field_4 = (unsigned __int64)(v42 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 v43 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 a1.field_0 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 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
10964 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 v28 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 v29 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 a1.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 v30 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 a1.pColorBuffer = &pRenderer->pTargetSurface[v30 + pRenderer->uTargetSurfacePitch * v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v30 + 640 * v28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 v31 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 v32 = ((signed int)v31->uTextureWidth >> v44) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 v33 = ((signed int)v31->uTextureHeight >> v44 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 a1.field_10 = v44 - v31->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 a1.field_C = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 a1.field_8 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 //----- (00484442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 signed int sr_sub_484442(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 int v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 signed int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 int v15; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 signed __int64 v16; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 int v17; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 int v18; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 signed int v20; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 stru149 *v22; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 signed int v23; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 int v24; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 int v25; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 unsigned int *v26; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 Texture *v27; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 signed int v28; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 signed int v29; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 signed int v31; // [sp+Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 int v32; // [sp+10h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 int v33; // [sp+14h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 stru316 v34; // [sp+18h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 stru315 v35; // [sp+40h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 int v36; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 int v37; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 int v38; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 int v39; // [sp+90h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 int v40; // [sp+94h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 int v41; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 v39 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 v7 = v40 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 v39 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 v36 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 v8 = ((unsigned __int64)(v39 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 v39 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 v9 = v40 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 v32 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 v33 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 v35.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 v41 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 v14 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 v31 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 v15 = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * v12 * (signed __int64)v3->v_18.y) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 v37 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 if ( !v15 || (v39 = abs(v14 >> 14), v39 > abs(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 LODWORD(v16) = v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 HIDWORD(v16) = v31 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 v40 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 v17 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 v18 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 HIWORD(v19) = (unsigned int)(v16 / v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 v35.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 v37 = v36 + ((unsigned __int64)(v3->ptr_38->field_10 * (signed __int64)v41) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 v36 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 v41 = (unsigned __int64)(v36 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 v38 += (unsigned __int64)(v36 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 v35.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 if ( v17 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 v35.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 if ( v17 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 if ( v17 < mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 v20 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail3;
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 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 v41 = (unsigned __int64)(v37 * (signed __int64)v17) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 v22 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 v41 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 v35.field_30 = ((unsigned __int64)(v37 * (signed __int64)v17) >> 16) - v22->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 v23 = ((unsigned __int64)(v38 * (signed __int64)v17) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 v24 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 v35.field_30 >>= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 v38 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 v35.field_2C = v23 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 v35.field_14 = dword_80AA20 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 v35.field_18 = dword_80AA1C >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 v35.field_1C = dword_80AA18 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 v35.field_20 = dword_80AA14 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 v38 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 v39 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v40) >> 16) >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 v35.field_4 = (unsigned __int64)(v39 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 v41 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 v35.field_0 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 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
11133 v25 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v26 = (unsigned int *)&pRenderer->pActiveZBuffer[v25 + 640 * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v35.pColorBuffer = &pRenderer->pTargetSurface[v25 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 v35.pDepthBuffer = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v27 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 v28 = (signed int)v27->uTextureWidth >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 v29 = (signed int)v27->uTextureHeight >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 v35.field_10 = v20 - v27->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 v35.field_C = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 v35.field_8 = (v29 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 sr_sub_485D3E(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 sr_sub_485C89(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 sr_sub_4D72EC(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 sr_sub_4D73DF(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 //----- (004847EB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 int sr_sub_4847EB(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 int v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 int v7; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 stru149 *v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 stru149 *v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 int v10; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 int v11; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 signed int v12; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 int v13; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 signed __int64 v14; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 signed int v16; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 unsigned __int16 *v17; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 stru149 *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 stru149 *v19; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 signed int v20; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 int v21; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 Texture *v22; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 signed int v23; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 int v24; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 int v25; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 int v26; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 int v27; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 int v28; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 int v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 signed __int64 v30; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 int v31; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 int v32; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 stru149 *v33; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 signed int v34; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 int v35; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 signed int v36; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 signed __int64 v37; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 signed int v38; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 int v39; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 int v40; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 unsigned __int64 v41; // qax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 int v42; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 int v43; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 signed __int64 v44; // qtt@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 int v45; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 int v46; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 stru149 *v47; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 signed int v48; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 int v49; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 int v50; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 unsigned __int64 v51; // qax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 int v52; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 int v53; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 signed __int64 v54; // qtt@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 int v55; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 int v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 stru149 *v57; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 signed int v58; // edi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 int v59; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 Span *v61; // [sp+Ch] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 int v62; // [sp+10h] [bp-ACh]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 int v63; // [sp+14h] [bp-A8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 int v64; // [sp+18h] [bp-A4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 int v65; // [sp+1Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 signed int v66; // [sp+20h] [bp-9Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 signed int v67; // [sp+24h] [bp-98h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 int v68; // [sp+28h] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 char v69; // [sp+2Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 stru315 sr; // [sp+30h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 stru316 sr2; // [sp+74h] [bp-48h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 int v72; // [sp+9Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 int v73; // [sp+A0h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 int v74; // [sp+A4h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 int v75; // [sp+A8h] [bp-14h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 int v76; // [sp+ACh] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 int v77; // [sp+B0h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 int v78; // [sp+B4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 int v79; // [sp+B8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 v2 = _this->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 v3 = _this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 v4 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 v61 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 sr.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 v5 = _this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 sr.pColorBuffer = &pRenderer->pTargetSurface[v3 + pRenderer->uTargetSurfacePitch * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 v68 = texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 v69 = texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 if ( v5 >= texmapping_terrain_subdivsize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 v73 = texmapping_terrain_subdivsize - (v3 & (texmapping_terrain_subdivsize - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 v6 = v5 - v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 v67 = v6 >> texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 v62 = v6 - (v6 >> texmapping_terrain_subdivpow2 << texmapping_terrain_subdivpow2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 v8 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 v79 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 v76 = v8->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 v9 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 v10 = v78 + v9->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 v76 = v9->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 v65 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 v11 = ((unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 + v4->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 v64 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 v76 = v4->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 v12 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 v63 = v78 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 v66 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 v78 = (unsigned __int64)(v79 * (signed __int64)v4->v_18.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 v74 = v78 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 if ( !(v78 + v63) || (v76 = v12 >> 14, v13 = abs(v12 >> 14), v13 > abs(v74)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 LODWORD(v14) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 HIDWORD(v14) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 v72 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 sr.pTextureLOD = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 v15 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 if ( v15 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 if ( v15 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 if ( v15 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 v16 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail1;
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 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 sr.pTextureLOD = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 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
11318 v18 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 v79 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 v77 = v65 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 v79 = v4->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 v79 = v64 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 v78 = (unsigned __int64)(v77 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 v19 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 v78 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 sr.field_30 = ((unsigned __int64)(v77 * (signed __int64)v72) >> 16) - v19->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 v78 = (unsigned __int64)(v79 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 v20 = ((unsigned __int64)(v79 * (signed __int64)v72) >> 16) - v4->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 v21 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 sr.field_30 >>= v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 v78 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 sr.field_2C = v20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 sr.field_14 = dword_80AA20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 sr.field_18 = dword_80AA1C >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 sr.field_1C = dword_80AA18 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 sr.field_20 = dword_80AA14 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 v22 = v4->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 v79 = (signed int)v22->uTextureWidth >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 v23 = (signed int)v22->uTextureHeight >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 v24 = v16 - v22->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 sr.field_8 = (v23 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 sr.field_10 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 sr.field_C = v79 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 v25 = v7 - v73 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 v77 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 v79 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 v27 = (unsigned __int64)(v77 * (signed __int64)v25) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 v28 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 v74 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 if ( !(v27 + v63) || (v77 = abs(v76), v29 = abs(v28), v77 > v29) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 LODWORD(v30) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 HIDWORD(v30) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 v77 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 v31 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 HIWORD(v32) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 if ( v72 <= v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 HIWORD(v32) = HIWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 LOWORD(v32) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 sr.field_24 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 v74 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 v74 = v65 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 v33 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 v34 = ((unsigned __int64)(v74 * (signed __int64)v31) >> 16) - v33->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 v74 = v33->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 v74 = v64 + ((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 v35 = (v77 - v4->ptr_38->field_28) >> v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 v74 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 v36 = (v34 >> v78) - sr.field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 LODWORD(v37) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 HIDWORD(v37) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 v38 = v35 - sr.field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 sr.field_4 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 v75 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 LODWORD(v37) = v38 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 HIDWORD(v37) = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 v77 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 sr.field_0 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 sr.field_28 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 v39 = v79 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 v79 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 v39 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 while ( v67 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 v40 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 v75 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 v41 = v40 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 v79 = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 LODWORD(v41) = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 v42 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 v74 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 if ( !((int)v41 + v63) || (v75 = abs(v76), v43 = abs(v42), v75 > v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 LODWORD(v44) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 HIDWORD(v44) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 v73 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 v45 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 HIWORD(v46) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 if ( v72 <= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 HIWORD(v46) = HIWORD(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 LOWORD(v46) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 sr.field_24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 v47 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 v48 = ((unsigned __int64)(v75 * (signed __int64)v45) >> 16) - v47->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 v75 = v47->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 v75 = v64 + ((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 v49 = (((v79 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 sr.field_4 = ((v48 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 sr.field_0 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 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
11463 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 v39 -= pOutdoorCamera->int_fov_rad_inv << v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 if ( !v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 v50 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 v75 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 v51 = v50 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 v79 = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 LODWORD(v51) = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 v52 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 v74 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 if ( (int)v51 + v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 v75 = abs(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 v53 = abs(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 if ( v75 <= v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 LODWORD(v54) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 HIDWORD(v54) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 v76 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 v55 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 HIWORD(v56) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 if ( v72 <= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 HIWORD(v56) = HIWORD(v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 LOWORD(v56) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 sr.field_24 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 v57 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 v58 = ((unsigned __int64)(v75 * (signed __int64)v55) >> 16) - v57->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 v75 = v57->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 v75 = v64 + ((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 v59 = (((v76 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 sr.field_4 = ((v58 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 sr.field_0 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 sr.field_28 = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 // 6BE050: using guessed type int texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 // 6BE054: using guessed type int texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 // 6BE0F0: using guessed type int mipmapping_terrain_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 // 6BE0F4: using guessed type int mipmapping_terrain_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 // 6BE0F8: using guessed type int mipmapping_terrain_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 // 80AA10: using guessed type char byte_80AA10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 //----- (00485407) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 signed int __fastcall sr_sub_485407_prolly_odm_water_wavy(Span *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 unsigned int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 int v8; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 stru149 *v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 stru149 *v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 signed int v15; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 int v16; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 int v18; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 unsigned __int8 *pLOD; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 Texture *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 Texture *v23; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 stru149 *v25; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 signed int v27; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 stru149 *v28; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 Texture *v29; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 signed int v30; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 signed int v31; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 signed int v32; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 int v34; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 int v35; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 unsigned __int64 v36; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 int v37; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 unsigned __int64 v38; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 char v39; // cl@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 stru316 a2; // [sp+Ch] [bp-90h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 stru315 a1a; // [sp+34h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 Span *v43; // [sp+78h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 int v44; // [sp+7Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 int v45; // [sp+80h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 int v46; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 Span *v47; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 int v48; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 int v49; // [sp+90h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 int i; // [sp+94h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 int X; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 v2 = a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 v3 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 v4 = v3 + pRenderer->uTargetSurfacePitch * a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 v5 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 v43 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 v6 = a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 a1a.pColorBuffer = &pRenderer->pTargetSurface[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 v46 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 a1a.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 v9 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 v47 = (Span *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 v48 = v9->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 v10 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 v11 = X + v10->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 v48 = v10->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 v12 = ((unsigned __int64)(v48 * (signed __int64)v8) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 v45 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 v48 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 v13 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 v14 = X + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 v15 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 v48 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 X = ((unsigned __int64)(v7 * (signed __int64)v13) >> 16) + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 if ( !X || (v16 = abs(v15 >> 14), v16 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 LODWORD(v17) = v48 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 HIDWORD(v17) = v48 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 i = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 v18 = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 HIWORD(v19) = (unsigned int)(v17 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 a1a.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 pLOD = v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 a1a.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 if ( v18 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 if ( v18 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 if ( v18 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 v49 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 pLOD = v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 pLOD = v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 pLOD = v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 v21 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 pLOD = v21->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 a1a.pTextureLOD = (unsigned __int16 *)pLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 if ( !pLOD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 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
11670 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 v43 = (Span *)(v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 v25 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 v48 = v46 - 16 * (v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 v46 = v25->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 v46 = v44 + ((unsigned __int64)(v46 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 v44 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 v45 += (unsigned __int64)(v44 * (signed __int64)v7) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 X = (unsigned __int64)(v46 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 X = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 v27 = ((unsigned __int64)(v46 * (signed __int64)v18) >> 16) - v26->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 X = (unsigned __int64)(v45 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 v28 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 v44 = bUseLoResSprites + v49 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 v30 = v27 >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 v31 = (signed int)(((unsigned __int64)(v45 * (signed __int64)v18) >> 16) - v28->field_28) >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 v32 = (signed int)v29->uTextureWidth >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 v33 = (signed int)v29->uTextureHeight >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 v34 = v49 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 a1a.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 X = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 v45 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 a1a.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 a1a.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 i = (unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 v47 = (Span *)(i >> v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 v36 = (signed int)v47 * (signed __int64)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 i = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 a1a.field_4 = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 v37 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 v38 = (signed int)v47 * (signed __int64)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 i = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 a1a.field_0 = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 if ( (signed int)v43 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 v47 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 v39 = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 for ( i = 12 - v49; ; v39 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> v39));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 v30 += 16 * a1a.field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 v31 += 16 * a1a.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 v47 = (Span *)((char *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 i = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> (12 - v49)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 a1a.field_28 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 //----- (0048585C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 signed int __fastcall sr_sub_48585C_mb_DrawSpan(Span *a1, unsigned __int16 *pRenderTarget, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 Span *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 stru148 *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 signed __int64 v6; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 signed int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 void *v9; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 int v10; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 unsigned __int16 *pPixels; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 signed int v13; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 int X; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 pPixels = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 v4 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 v13 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 X = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763 * (pViewport->uScreenCenterX - (signed int)a1->field_8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 * (signed __int64)v4->v_18.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 + ((unsigned __int64)(v4->v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 * (pViewport->uScreenCenterY - (signed int)a1->field_A))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 if ( X && (v5 = abs(-v4->field_24 >> 14), v5 <= abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 LODWORD(v6) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 HIDWORD(v6) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 v7 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 v8 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 v7 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 v8 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 v9 = sr_sub_47C178(v8, v4, pOutdoorCamera->terrain_gamma, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 fill_pixels_fast(*((short *)v9 + v4->pTexture->uDecompressedSize), pPixels, v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 HIWORD(v10) = HIWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 LOWORD(v10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 j_memset32(v10, &pRenderer->pActiveZBuffer[v3->field_8 + 640 * v3->field_A], v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789 //----- (00485975) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 stru315 *__fastcall sr_sub_485975(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 v11 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 //----- (00485A24) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 stru315 *__fastcall sr_sub_485A24(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11900 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 v14 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 //----- (00485AFF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 stru315 *__fastcall sr_sub_485AFF(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 v7 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 v11 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 //----- (00485BAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 stru315 *__fastcall sr_sub_485BAE(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 v10 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 v14 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 //----- (00485C89) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 stru315 *__fastcall sr_sub_485C89(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 int v7; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 int v8; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 unsigned __int16 *v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 unsigned int *v11; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 int v12; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 int v13; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 v13 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 if ( *((char *)result->pTextureLOD + v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 if ( a2->field_8 - v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 v9 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 v10 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 v6 = v13 + (v9 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 v10 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 *result->pColorBuffer = v10[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 v11 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 v12 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 //----- (00485D3E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 stru315 *__fastcall sr_sub_485D3E(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144 int v10; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 int v11; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 int v12; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 unsigned __int16 *v13; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148 unsigned int *v14; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 int v15; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 int v16; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 v16 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 if ( *((char *)result->pTextureLOD + v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 if ( a2->field_8 - v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 v12 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 v13 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 v9 = v16 + (v12 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 v13 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 *result->pColorBuffer = v13[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 v14 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 v15 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 *v14 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12203 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 //----- (00485E1F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 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
12213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 stru316 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 signed int *v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216 signed int *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 char v10; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 Span *v12; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 double v13; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 double v14; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 int v15; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 signed int v16; // ST14_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 char v17; // dl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 signed int v18; // ST10_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 void *v19; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 signed int v20; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 char v21; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 int v22; // ST10_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 signed int v23; // ST14_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 char v24; // dl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 Span *v26; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 char v27; // [sp+16h] [bp-2h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 char v28; // [sp+17h] [bp-1h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 float v29; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 float v30; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 v7 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 v8 = &a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 v9 = &a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 v10 = a1->field_0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 v27 = a1->field_4 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 v28 = !v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 sr_sub_47BEB1(a3, a4, a5, 0, &a1->field_8, &a1->field_C, (int)&v27, (int)&v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 v7->field_24_palette = (unsigned __int16 *)sr_sub_47C28C_get_palette(a4, v28, *v9, *v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 v11 = a4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 v7->field_20 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 if ( a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 v12 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 v29 = v26->field_10 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 v13 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 v7->field_10 = LODWORD(v13) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 v30 = v12->field_14 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 v14 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 v15 = v7->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 v7->field_14 = LODWORD(v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 v7->field_18 = -((v15 - (LODWORD(v14) << 16)) / v12->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v16 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 v17 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 v18 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 v7->field_1C = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 v19 = sr_sub_47C28C_get_palette(a4, v17, v18, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 v20 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 v21 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 v7->field_10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 v7->field_14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 v22 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 v7->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 v7->field_1C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 v19 = sr_sub_47C1CA(a4, v21, v22, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 v23 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 v7->field_24_palette = (unsigned __int16 *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 return sr_sub_47C1CA(a4, v24, *v9, v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 //----- (00485F53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 void __thiscall sub_485F53(Vec2_int_ *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 ++v->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 if ( v->y > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 v->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 //----- (00485F64) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 void OutdoorCamera::_485F64()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 signed __int64 v3; // qtt@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 this->uCameraFovInDegrees = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 v1 = stru_5C6E00->uPiMask & 0xD5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 if ( v1 >= (signed int)stru_5C6E00->uIntegerHalfPi )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 v2 = -stru_5C6E00->pTanTable[stru_5C6E00->uIntegerPi - v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 v2 = stru_5C6E00->pTanTable[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 LODWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 HIDWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 v4 = (signed int)(v3 / v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 this->int_fov_rad = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 this->field_4C = 360000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 this->int_fov_rad_inv = 65536 / v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316 this->field_50 = 115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 unnamed_6BE060[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 //----- (0048600E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 void OutdoorCamera::RotationToInts()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 camera_rotation_y_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 camera_rotation_y_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326 camera_rotation_x_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 camera_rotation_x_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 //----- (0048607B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 void stru148::_48607B(stru149 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 this->pTexture = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 this->ptr_38 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 //----- (00486089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 void stru148::_486089_normalize_v_18()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 stru148 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 double v3; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 float v4; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 double v5; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 float v6; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 double v7; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 float v8; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 float v9; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 double v10; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 float v11; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 double v12; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 float v13; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 double v14; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 float v15; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 v2 = (double)this->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 v3 = (double)this->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 v5 = (double)this->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 v7 = sqrt(v5 * v5 + v3 * v3 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 v1->v_18.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 v1->v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 v1->v_18.z = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 v8 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 v9 = v8 * v15 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 v1->v_18.x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 v11 = v8 * v4 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 v1->v_18.y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 v13 = v8 * v6 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 v1->v_18.z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 //----- (0048616B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 int stru149::_48616B(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 int v8; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 int v13; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 int v14; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 int v15; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 int v16; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 int v17; // ST0C_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 int v18; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 int v19; // ST0C_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 int v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 int v21; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 int v24; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 int v25; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 int v26; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 int v27; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 int v28; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 int v29; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 v25 = pOutdoorCamera->camera_rotation_x_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 v7 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 v27 = pOutdoorCamera->camera_rotation_x_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 v8 = -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 v9 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 v26 = -pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 v24 = -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 v10 = pOutdoorCamera->camera_rotation_y_int_cosine * -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 v11 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 v14 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 v15 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 this->field_0 = ((unsigned __int64)(v11 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 + ((unsigned __int64)(-65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 * pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 this->field_4 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 v13 = ((unsigned __int64)((v26 << 16) * (signed __int64)v25) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 - ((unsigned __int64)(v14 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 this->field_4 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 this->field_0 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 v13 = v26 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 this->field_8 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 v17 = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 this->field_C = ((unsigned __int64)(v17 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 + ((unsigned __int64)(a4 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 v16 = ((unsigned __int64)(a4 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v17 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 this->field_C = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 v16 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 this->field_14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 v19 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 this->field_18 = ((unsigned __int64)(v19 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 + ((unsigned __int64)(a7 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 v18 = ((unsigned __int64)(a7 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 this->field_18 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 v18 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 this->field_20 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 v20 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 v21 = ((unsigned __int64)(v20 * (signed __int64)this->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 v28 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 v22 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 this->field_24 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 v29 = (unsigned __int64)(v28 * (signed __int64)v22) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 this->field_28 = v29 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 //----- (0048653D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 int stru149::_48653D(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 stru149 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 int v13; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 int v14; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 int v15; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 int v16; // ST14_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 int v17; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 int v18; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 int v19; // ST10_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 int v20; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 int v21; // ST10_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 int v23; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 int v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 int v26; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 int v27; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 int v28; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 int v29; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 int v30; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 int v31; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 v8 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 v29 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 v28 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 v11 = -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 v26 = -pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 v27 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 v12 = -pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 v16 = v8 * -pBLVRenderParams->vPartyPos.x + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 v17 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 v7->field_0 = ((unsigned __int64)(v16 * (signed __int64)v28) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 v15 = ((unsigned __int64)(v17 * (signed __int64)v28) >> 16) - ((unsigned __int64)(v16 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 v7->field_0 = v10 + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 v15 = v12 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 v7->field_8 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 v19 = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 v7->field_C = ((unsigned __int64)(v19 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 + ((unsigned __int64)(a4 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 v18 = ((unsigned __int64)(a4 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 v7->field_C = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 v18 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 v7->field_14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 v21 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 v7->field_18 = ((unsigned __int64)(v21 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 + ((unsigned __int64)(a7 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 v20 = ((unsigned __int64)(a7 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v21 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 v7->field_18 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 v20 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 v7->field_18 = -v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 v7->field_1C = -v7->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 v7->field_20 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 v22 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 v7->field_20 = -v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 v23 = ((unsigned __int64)(v22 * (signed __int64)v7->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 + ((unsigned __int64)(v7->field_10 * (signed __int64)v7->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 + ((unsigned __int64)(v7->field_14 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 v30 = v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 v24 = v7->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 v7->field_24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 v31 = (unsigned __int64)(v30 * (signed __int64)v24) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 result = (unsigned __int64)(v7->field_1C * (signed __int64)v7->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 v7->field_28 = v31 + result + ((unsigned __int64)(v7->field_20 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 //----- (0048694B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 int stru149::_48694B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 int v2; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 int v3; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 int v5; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 v1 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 v2 = (unsigned __int64)(v1 * (signed __int64)this->field_0) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 v3 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 v4 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 this->field_24 = v2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 v5 = (unsigned __int64)(v3 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 this->field_28 = v5 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 //----- (00486A28) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 void OutdoorCamera::AllocSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 if ( !this || !pSpans )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 ReleaseSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 pSpans = (Span *)pAllocator->AllocNamedChunk(pSpans, 0x493E0u, "SPANS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 pEdges = (Edge *)pAllocator->AllocNamedChunk(pEdges, 0x4C2C0u, "EDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 pSurfs = (Surf *)pAllocator->AllocNamedChunk(pSurfs, 0x11940u, "SURFS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 pNewEdges = (Edge *)pAllocator->AllocNamedChunk(pNewEdges, 0x6180u, "NEWEDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 memset(pSpans, 0, 0x493E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 memset(pEdges, 0, 0x4C2C0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 memset(pSurfs, 0, 0x11940u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 memset(pNewEdges, 0, 0x6180u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 //----- (00486AFC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 void OutdoorCamera::ReleaseSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 pAllocator->FreeChunk(pSpans);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 pAllocator->FreeChunk(pEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 pAllocator->FreeChunk(pSurfs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 pAllocator->FreeChunk(pNewEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 pSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 pEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 pSurfs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 pNewEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 //----- (00486B4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 char __fastcall sr_sub_486B4E_push_outdoor_edges(RenderVertexSoft *a1, int *a2, int *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 RenderVertexSoft *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 char v6; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 int *v9; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 int v10; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 int v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 double v12; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 int *v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 double v14; // st6@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 double v15; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 int v16; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 double v17; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 double v18; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 int v19; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 double v20; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 double v21; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 Edge *i; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 double v23; // st7@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 Edge *v24; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 std::string v26; // [sp-18h] [bp-98h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 const char *v27; // [sp-8h] [bp-88h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 int v28; // [sp-4h] [bp-84h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 double v29; // [sp+Ch] [bp-74h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 double v30; // [sp+14h] [bp-6Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 double v31; // [sp+1Ch] [bp-64h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 double v32; // [sp+24h] [bp-5Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 double v33; // [sp+2Ch] [bp-54h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 unsigned int v34; // [sp+34h] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 unsigned __int64 v35; // [sp+38h] [bp-48h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 int v36; // [sp+40h] [bp-40h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 int v37; // [sp+44h] [bp-3Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 float v38; // [sp+48h] [bp-38h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 int v39; // [sp+4Ch] [bp-34h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 int v40; // [sp+50h] [bp-30h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 int v41; // [sp+54h] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 RenderVertexSoft *v42; // [sp+58h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 int v43; // [sp+5Ch] [bp-24h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 int v44; // [sp+60h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 int v45; // [sp+64h] [bp-1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 unsigned int v46; // [sp+68h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 int *v47; // [sp+6Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 int v48; // [sp+70h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 float *v49; // [sp+74h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 float v50; // [sp+78h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 float v51; // [sp+7Ch] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 v47 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 v6 = (HIBYTE(a4->flags) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 v42 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 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
12721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 LOBYTE(v7) = v4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 v8 = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 v4->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 BYTE3(a4) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 if ( (signed int)pOutdoorCamera->uNumSurfs < 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 v7 = pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 if ( (signed int)pOutdoorCamera->uNumEdges < 5979 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 v4->uEdgeList1Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 v4->uEdgeList2Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 v45 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 v34 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 v28 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 v27 = (const char *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 v44 = 10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 pGame->pLightmapBuilder->_45CB89(v5, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 v9 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 v49 = &v5->flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 v46 = (char *)v47 - (char *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 v10 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 ++pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 if ( v48 >= v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 v11 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 LODWORD(v50) = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 if ( SLODWORD(v50) > v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 v45 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 if ( v11 < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 v12 = (double)SLODWORD(v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 v13 = &a3[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 v51 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 v14 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 v50 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 *(float *)&v40 = v14 - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 v33 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 v43 = LODWORD(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 if ( LODWORD(v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 if ( SLODWORD(v33) >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 v19 = (int)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 ptr_80C978_Edges->field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 LODWORD(v38) = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 v40 = *(unsigned int *)LODWORD(v38) - *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 v20 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 v40 = *v13 - *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 v21 = v20 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 ptr_80C978_Edges->field_4 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 ptr_80C978_Edges->field_0 = (v51 - (double)*v9) * v21 + (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 ptr_80C978_Edges->field_1C = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 ptr_80C978_Edges->field_20 = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 ptr_80C978_Edges->field_24 = (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 ptr_80C978_Edges->field_28 = (double)(signed int)*(unsigned int *)LODWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 ptr_80C978_Edges->field_2C = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 ptr_80C978_Edges->field_30 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 v4->pEdgeList1[v4->uEdgeList1Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 v32 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 v39 = LODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 v51 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 v15 = (double)SLODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 ptr_80C978_Edges->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 v16 = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 v50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 v40 = *(int *)((char *)v9 + v46) - *(int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 v17 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 v40 = *v9 - *v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 v18 = v17 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 ptr_80C978_Edges->field_4 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 ptr_80C978_Edges->field_0 = (v51 - (double)*v13) * v18 + (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 ptr_80C978_Edges->field_1C = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 ptr_80C978_Edges->field_20 = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 ptr_80C978_Edges->field_24 = (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 ptr_80C978_Edges->field_28 = (double)*(int *)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 ptr_80C978_Edges->field_2C = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 ptr_80C978_Edges->field_30 = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 v4->pEdgeList2[v4->uEdgeList2Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 v31 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 v37 = LODWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 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
12823 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 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
12825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 ptr_80C978_Edges->pNext = i->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 i->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 ptr_80C978_Edges->pNext = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 i->pPrev->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 v23 = v50 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 *(float *)&v40 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 v38 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 v30 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 v36 = LODWORD(v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 ptr_80C978_Edges->ptr_18 = ptr_80CA10[LODWORD(v30)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 v29 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 v35 = __PAIR__(v40, LODWORD(v29));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 v24 = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 ptr_80CA10[LODWORD(v29)] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 v24->pSurf = ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 if ( ptr_80C978_Edges < &pEdges[5999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846 ++ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 v49 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 while ( v48 - 1 < v41 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 LOBYTE(v7) = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 if ( pOutdoorCamera->uNumEdges != v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 v4->ptr_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 ptr_80C97C_Surfs->field_22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 ptr_80C97C_Surfs->pParent = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 ptr_80C97C_Surfs->field_4 = v4->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 ptr_80C97C_Surfs->field_8 = v4->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 ptr_80C97C_Surfs->field_0 = v4->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 ptr_80C97C_Surfs->field_C = v4->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 ptr_80C97C_Surfs->field_10 = v4->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 LOBYTE(v7) = (char)pSurfs + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 if ( ptr_80C97C_Surfs < &pSurfs[1999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 ++ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 ++pOutdoorCamera->uNumSurfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 if ( BYTE3(a4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 v4->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 }
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 //----- (0043F953) --------------------------------------------------------
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
12883 void PrepareWallsRenderList_BLV()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 pStru170->uNumFaceIDs = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12886 if ( pBLVRenderParams->uPartySectorID )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12887 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12888 pStru170->field_FA8[0].uSectorID = pBLVRenderParams->uPartySectorID;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12889 pStru170->field_FA8[0].uViewportW = pBLVRenderParams->uViewportW;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12890 pStru170->field_FA8[0].uViewportZ = pBLVRenderParams->uViewportZ;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12891 pStru170->field_FA8[0].uViewportY = pBLVRenderParams->uViewportY;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12892 pStru170->field_FA8[0].uViewportX = pBLVRenderParams->uViewportX;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 pStru170->field_FA8[0].field_C._43F9E1(
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12894 pBLVRenderParams->uViewportX,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12895 pBLVRenderParams->uViewportY,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12896 pBLVRenderParams->uViewportZ,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12897 pBLVRenderParams->uViewportW);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 pStru170->field_FA8[0].uFaceID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 pStru170->field_FA8[0].std__vector_0007A8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900 pStru170->std__vector_000FA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901 sub_440639(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902 }
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
12903 pStru170->MakeVisibleSectorList();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 //----- (0043F9E1) --------------------------------------------------------
98
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12907 void stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w)
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12908 {
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12909 __debugbreak();
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12910
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12911 _viewport_space_y = y;
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12912 _viewport_space_w = w;
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12913
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12914 for (uint i = 0; i < 480; ++i)
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12915 {
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12916 if ( i < y || i > w )
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12917 {
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12918 array_3D8[i] = -1;
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12919 array_18[i] = 640;
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12920 }
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12921 else
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12922 {
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12923 array_18[i] = x;
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12924 array_3D8[i] = z;
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12925 }
f76e4ea4a224 Outdoor::Load
Nomad
parents: 94
diff changeset
12926 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 //----- (0043FA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 LevelDecoration *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 DecorationDesc *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 __int16 v4; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 unsigned int v8; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 int v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 SpriteFrame *v11; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 SpriteFrame *v12; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 RenderBillboard *v15; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 char v16; // zf@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 IndoorCameraD3D **v17; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 double v18; // st7@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 float v19; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 signed __int64 v20; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 signed __int64 v21; // qtt@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 int v23; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 Particle_ local_0; // [sp+Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 double v25; // [sp+74h] [bp-38h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 unsigned int v26; // [sp+7Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 int a2; // [sp+80h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 int a3; // [sp+84h] [bp-28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 int a1; // [sp+88h] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 int v30; // [sp+8Ch] [bp-20h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 float v31; // [sp+90h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 int a5; // [sp+94h] [bp-18h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 int z; // [sp+98h] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 int a6; // [sp+9Ch] [bp-10h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 int y; // [sp+A0h] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 int x; // [sp+A4h] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 int v37; // [sp+A8h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 v26 = uDecorationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 LODWORD(v31) = uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 v2 = &pLevelDecorations[uDecorationID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 if ( !(v2->field_2 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 v4 = v3->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 if ( (char)v4 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 if ( !(v4 & DECORATION_DONT_DRAW) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 v6 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 v7 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 a2 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 a1 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 a3 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 v8 = v2->field_10_y_rot
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 + ((signed int)stru_5C6E00->uIntegerPi >> 3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 v37 = pBLVRenderParams->field_0_timer_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 v37 = pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 v10 = abs(v2->vPosition.x + v2->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 v13 = v11->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 if ( v13 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 v30 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 if ( v13 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 if ( v13 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 LOBYTE(v30) = v30 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 if ( (256 << v9) & v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1, a2, a3, &x, &y, &z, 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 v14 = abs(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 if ( v14 >= abs(y) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 v15 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 if ( (signed int)uNumBillboardsToDraw < 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 ++uNumDecorationsDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 v16 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 v15->uHwSpriteID = v12->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 v15->uPalette = v12->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 v15->uIndoorSectorID = LOWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 LODWORD(v21) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v21 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 v17 = &pGame->pIndoorCameraD3D;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13033 v15->fov_x = pGame->pIndoorCameraD3D->fov_x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13034 v18 = (*v17)->fov_y;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13035 v19 = v15->fov_x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13036 v15->fov_y = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 v31 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 v25 = v19 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13045 v31 = v15->fov_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 v25 = v31 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 HIWORD(v22) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 v15->field_4 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 v15->field_1E = v30;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13055 v15->some_x = a1;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13056 v15->some_y = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13057 v15->some_z = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13058 v15->uScreenSpaceX = a5;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13059 v15->uScreenSpaceY = a6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 v23 = 8 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 LOBYTE(v23) = 8 * v26 | 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 LOWORD(v22) = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13063 v15->uTintColor = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 v15->sZValue = v22 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 v15->pSpriteFrame = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 v5 = (double)v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 local_0.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 local_0.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 local_0.x = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 local_0.y = (double)v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 local_0.z = (double)v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 local_0.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 local_0.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 local_0.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 local_0.flt_28 = 1.0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13084 local_0.timeToLive = (rand() & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 pGame->pParticleEngine->AddParticle(&local_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 //----- (0044028F) --------------------------------------------------------
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13093 void PrepareItemsRenderList_BLV()
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13094 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 ObjectDesc *v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13096 __int16 v2; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 RenderBillboard *v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 SpriteFrame *v4; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 SpriteFrame *v5; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 int v7; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 int v8; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 int v9; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 unsigned __int16 v10; // ax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 int *v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 char v12; // zf@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 int v18; // ST5C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 signed __int64 v19; // qtt@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 int v20; // ST5C_4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 int v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 __int16 v22; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 int v23; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 __int16 a5; // [sp+28h] [bp-34h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 int a6; // [sp+2Ch] [bp-30h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 int a2; // [sp+30h] [bp-2Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 int a1; // [sp+34h] [bp-28h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 int v30; // [sp+38h] [bp-24h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 int v31; // [sp+38h] [bp-24h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 int a3; // [sp+40h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 signed __int16 v34; // [sp+44h] [bp-18h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 int v35; // [sp+48h] [bp-14h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 int v36; // [sp+4Ch] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 signed int z; // [sp+50h] [bp-Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 signed int y; // [sp+54h] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 signed int x; // [sp+58h] [bp-4h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13128 for (uint i = 0; i < uNumLayingItems; ++i)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13129 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13130 auto p = pLayingItems + i;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13131 if (p->uObjectDescID)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13132 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13133 v1 = &pObjectList->pObjects[p->uObjectDescID];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 if ( !(v1->uFlags & 1) )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13135 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13136 if ( ((v2 = p->uItemType, v2 < 1000) || v2 >= 10000)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 && (v2 < 500 || v2 >= 600)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 && (v2 < 811 || v2 >= 815)
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13139 || pGame->pStru6Instance->_4A81CA(p))
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13140 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13141 a5 = p->uSectorID;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13142 a1 = p->vPosition.x;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13143 a2 = p->vPosition.y;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13144 a3 = p->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 v3 = &pBillboardRenderList[uNumBillboardsToDraw];
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13146 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, p->uSpriteFrameID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 v24 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 v30 = v4->uFlags;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13150 a6 = v4->uGlowRadius * p->field_22;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 v6 = stru_5C6E00->Atan2(
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13152 p->vPosition.x - pBLVRenderParams->vPartyPos.x,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13153 p->vPosition.y - pBLVRenderParams->vPartyPos.y);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13154 LOWORD(v7) = p->uFacing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157 v10 = v5->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 v3->uHwSpriteID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159 if ( v30 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 a3 -= (signed int)((unsigned __int64)(v5->scale
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 if ( v8 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13167 v34 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 if ( v8 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13169 v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13170 if ( v8 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 LOBYTE(v34) = v34 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 v11 = (int *)(256 << v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 if ( (256 << v9) & v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 v34 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 if ( a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 LOBYTE(v11) = byte_4E94D3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 pMobileLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 a6,
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13184 v1->uParticleTrailColorR,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13185 v1->uParticleTrailColorG,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13186 v1->uParticleTrailColorB,
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13187 byte_4E94D3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 &x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 &y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 &z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 if ( (signed int)uNumBillboardsToDraw >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 ++uNumSpritesDrawnThisFrame;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13203 p->uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 v12 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 v3->uPalette = v24->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 v3->uIndoorSectorID = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 LODWORD(v19) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 HIDWORD(v19) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 v20 = v19 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 v3->field_0 = (unsigned __int64)(v24->scale * v19 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13217 v3->fov_x = pGame->pIndoorCameraD3D->fov_x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13218 v3->fov_y = pGame->pIndoorCameraD3D->fov_y;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13219 v18 = (int)floorf(v3->fov_x + 0.5f) / x;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13220 v3->field_0 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13221 v31 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 HIWORD(v21) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 v3->field_4 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 v3->field_1E = v34;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13226 v3->some_x = a1;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13227 v3->some_y = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13228 v3->some_z = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13229 v3->uScreenSpaceX = v36;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 v22 = v35;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13231 v3->uTintColor = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13232 v3->uScreenSpaceY = v22;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 LOWORD(v21) = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13234 v23 = 8 * i;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13235 LOBYTE(v23) = 8 * i | 2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 v3->pSpriteFrame = v24;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13237 v12 = (p->uAttributes & 0x20) == 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 v3->sZValue = v21 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 v3->sZValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13253 //----- (00440639) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13254 void __fastcall sub_440639(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 BLVSector *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 v3 = &pIndoor->pSectors[pStru170->field_FA8[a1].uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 do
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13268 {
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13269 Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13270 pStru170->PrepareFaceRenderList_d3d(v1, v3->pFaceIDs[v2++]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13271 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 do
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13280 pStru170->PrepareFaceRenderList_sw(v1, v3->pFaceIDs[v2++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 if ( v3->field_0 & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285 sub_4406BC(v1, v3->uFirstBSPNode);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 //----- (004406BC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 void __fastcall sub_4406BC(int a1, unsigned int uFirstNode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 BLVSector *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 BSPNode *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293 BLVFace *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 __int16 v6; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 int v7; // ebp@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 int v8; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 __int16 v9; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 int v10; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 bool v11; // [sp+14h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13302
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13303 Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13304
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13305 v10 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306 v12 = &pStru170->field_FA8[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 v2 = &pIndoor->pSectors[v12->uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 v3 = &pIndoor->pNodes[uFirstNode];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 v4 = &pIndoor->pFaces[v2->pFaceIDs[v3->uCoplanarOffset]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 v5 = v4->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 + pBLVRenderParams->vPartyPos.x * v4->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 + pBLVRenderParams->vPartyPos.y * v4->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 + pBLVRenderParams->vPartyPos.z * v4->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 if ( v4->uAttributes & 1 && v4->uSectorID != v12->uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 v5 = -v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 v11 = v5 > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 if ( v5 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 v6 = v3->uFront;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 v6 = v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 sub_4406BC(v10, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 v7 = v3->uCoplanarOffset;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 v8 = v7 + v3->uCoplanarSize;
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13327
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13328 Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13329
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 while ( v7 < v8 )
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13333 pStru170->PrepareFaceRenderList_d3d(v10, v2->pFaceIDs[v7++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337 while ( v7 < v8 )
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13338 pStru170->PrepareFaceRenderList_sw(v10, v2->pFaceIDs[v7++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 v9 = v11 ? v3->uFront : v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 if ( v9 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 uFirstNode = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 //----- (00440DF5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 int stru167_wrap::Push(__int16 a2, __int16 a3, __int16 a4, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13352 pElements[uNumElements].field_6_rnd_value = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13353 pElements[uNumElements].field_8_rnd_value = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13354 pElements[uNumElements].field_A_rnd_value = a4;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13355 pElements[uNumElements].field_C_time_left = rand() % 64 + 256;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13356 pElements[uNumElements].field_E_time_to_live = pElements[uNumElements].field_C_time_left;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13357 result = 3 * uNumElements;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13358 pElements[uNumElements++].bgr16 = bgr;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13359 if (uNumElements >= 100 )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13360 uNumElements = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13361 return result;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 //----- (00440E91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 void stru167_wrap::_440E91(__int16 x, int y, int z, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 stru167_wrap *v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 int i; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 int v8; // ST08_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 int v9; // ST04_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 int v10; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 for ( i = 0; i < rand() % 6 + 5; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 v8 = z + rand() % 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 v9 = rand() % 33 + y - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 Push(v10 % 33 + x - 16, v9, v8, a5, bgr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 //----- (00440F07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 void stru167_wrap::_440F07()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13386 for (uint i = 0; i < 100; ++i)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13387 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13388 if (pElements[i].field_C_time_left > 0)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13389 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13390 pElements[i].field_A_rnd_value += rand() % 5 + 4;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13391 pElements[i].field_6_rnd_value += rand() % 5 - 2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13392 pElements[i].field_8_rnd_value += rand() % 5 - 2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13393 pElements[i].field_C_time_left -= (short)pEventTimer->uTimeElapsed;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13394 }
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13395 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 //----- (0044100D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 bool __cdecl sub_44100D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13401 return pCurrentScreen == 4
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13402 || pCurrentScreen == 7
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13403 || pCurrentScreen > 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13404 && (pCurrentScreen <= 14
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13405 || pCurrentScreen > 16
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13406 && (pCurrentScreen <= 18
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13407 || pCurrentScreen == 23));
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13408 }
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13409 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 //----- (00441498) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 void __cdecl GameUI_DrawTorchlightAndWizardEye()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 unsigned int v0; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 IconFrame *v1; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 unsigned int v2; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 IconFrame *v3; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13419 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13420 || pCurrentScreen == 1
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13421 || pCurrentScreen == 2
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13422 || pCurrentScreen == 5
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13423 || pCurrentScreen == 8
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13424 || pCurrentScreen == 10
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13425 || pCurrentScreen == 11
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13426 || pCurrentScreen == 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13427 || pCurrentScreen == 15
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13428 || pCurrentScreen == 3
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13429 || pCurrentScreen == 19 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 v0 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435 v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 pUIAnum_Torchlight->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13438 pUIAnum_Torchlight->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 &pIcons_LOD->pTextures[v1->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444 v2 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 pUIAnim_WizardEye->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 pUIAnim_WizardEye->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 &pIcons_LOD->pTextures[v3->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13453 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 //----- (0044158F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 void __cdecl GameUI_DrawCharacterSelectionFrame()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 pRenderer->DrawTextureTransparent(
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13460 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 0x17Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 &pIcons_LOD->pTextures[dword_50C98C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 }
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13464
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 //----- (004415C5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 void __cdecl Load_isn_spells_21_27()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 char pContainer[120]; // [sp+8h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 sprintf(pContainer, "isn-%02d", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478 while ( v0 < 14 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 //----- (0044162D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 void __cdecl GameUI_DrawPartySpells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 unsigned int v0; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 int v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 __int16 *v4; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 Player *v5; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 unsigned int v6; // [sp-4h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 Texture *v7; // [sp-4h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 unsigned int v8; // [sp-4h] [bp-1Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 Texture *v9; // [sp-4h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 Player **v10; // [sp+10h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 v2 = (unsigned __int8)byte_4E5DD8[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 v3 = pTextureIDs_isns[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 pRenderer->_4A65CC(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 pPartySpellbuffsUI_XYs[v1][0],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509 pPartySpellbuffsUI_XYs[v1][1],
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13510 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13511 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512 v0 + 20 * pPartySpellbuffsUI_smthns[v1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514 63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518 while ( v1 < 14 );
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13519 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13520 || pCurrentScreen == 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13528 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 pRenderer->DrawTextureIndexed(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 pRenderer->DrawTextureTransparent(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 if ( pParty->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 v8 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 pRenderer->DrawTextureIndexed(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 pRenderer->DrawTextureTransparent(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13548
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13549 uint _it = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 v10 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 v5 = *v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 0x1ABu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13559 (Texture *)(dword_507964 != -1 ? &pIcons_LOD->pTextures[dword_507964] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563 0x189u,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13564 (Texture *)(dword_50796C != -1 ? &pIcons_LOD->pTextures[dword_50796C] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 0x19Au,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13569 (Texture *)(dword_507968 != -1 ? &pIcons_LOD->pTextures[dword_507968] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 0x1BCu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13574 (Texture *)(dword_507960 != -1 ? &pIcons_LOD->pTextures[dword_507960] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13578 //while ( (signed int)v4 < (signed int)pBaseHealthByClass );
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13579 while (++_it != 4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 //----- (00441A4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 __int16 __fastcall sub_441A4E(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 __int16 result; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 char *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 int v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 SpriteFrame *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 SpriteFrame *v7; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 unsigned __int16 v9; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 RenderBillboardTransform_local0 v10; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 int v11; // [sp+5Ch] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 int v12; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598 int v13; // [sp+64h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 v10.uParentBillboardID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 v10.pTarget = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 v10.pTargetZ = pRenderer->pActiveZBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 v10.uTargetPitch = pRenderer->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 v10.uViewportX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 v10.uViewportY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 v10.uViewportZ = 639;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 v10.uViewportW = 479;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 v3 = (char *)&pOtherOverlayList->pOverlays[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 if ( *((short *)v3 - 3) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616 result = *((short *)v3 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 if ( result >= 300 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 v4 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 v5 = result == v2 + 320 | result == v2 + 330 | result == v2 + 340 | result == v2 + 350;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621 result = v2 + 310;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 if ( v4 == v2 + 310 | v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 if ( !*(short *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 v6 = pSpriteFrameTable->GetFrame(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 pOverlayList->pOverlays[*((short *)v3 - 5)].uSpriteFramesetID,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628 *((short *)v3 - 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 v11 = *((int *)v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631 v13 = v6->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 v13 = (unsigned __int64)(v11 * (signed __int64)v13) >> 16;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13633 v10.uScreenSpaceX = *((short *)v3 - 2);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13634 v10.uScreenSpaceY = *((short *)v3 - 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 v10.field_10 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 v10.field_14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v6->uPaletteIndex, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 v8 = *((short *)v3 - 5);
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13639 v10.sZValue = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 v10.uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 v9 = pOverlayList->pOverlays[v8].uOverlayType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 if ( !v9 || v9 == 2 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13643 v10.uScreenSpaceY += pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]].uHeight >> 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 result = pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]]._4AD2D1(&v10, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 if ( v12 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 v3 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 //----- (00441D38) --------------------------------------------------------
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13661 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
13662 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13663 int uHeight; // ebx@6
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13664 //unsigned int v9; // edx@9
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13665 //unsigned int v10; // ebx@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 __int16 v11; // cx@11
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13667 //BLVFace *v12; // ecx@17
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13668 //unsigned int v13; // ecx@21
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 unsigned int v14; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 int v15; // eax@23
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13671 //unsigned int *v16; // ecx@28
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 __int16 v17; // di@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673 double v18; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 float v19; // ST38_4@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 double v20; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 double v21; // st6@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 double v22; // st5@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 unsigned __int16 *v26; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 signed int v27; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 unsigned __int16 *v28; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 signed int v29; // edi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 int v30; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 unsigned __int16 *v31; // ebx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 signed int v32; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 signed int v33; // ebx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 unsigned int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 signed int v35; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 unsigned __int16 v36; // di@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 int v37; // edi@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 int v38; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 __int16 v39; // ax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 int v40; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 int v41; // ebx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 unsigned int v42; // eax@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 unsigned int v43; // ebx@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 unsigned int v44; // ST30_4@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 char *v45; // ebx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 int v46; // edi@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 int v47; // eax@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 unsigned int v48; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 unsigned int v49; // ST64_4@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 double v50; // ST20_8@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 unsigned int v51; // [sp-10h] [bp-64h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 unsigned int v52; // [sp-10h] [bp-64h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 unsigned int v53; // [sp-Ch] [bp-60h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 unsigned int v54; // [sp-Ch] [bp-60h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 unsigned int v55; // [sp-8h] [bp-5Ch]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 unsigned int v56; // [sp-8h] [bp-5Ch]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 signed int v57; // [sp-4h] [bp-58h]@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 unsigned __int16 v58; // [sp-4h] [bp-58h]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 unsigned __int16 v59; // [sp-4h] [bp-58h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 unsigned __int16 v60; // [sp+10h] [bp-44h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 unsigned int v61; // [sp+10h] [bp-44h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714 unsigned __int16 *v62; // [sp+14h] [bp-40h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 unsigned int v63; // [sp+14h] [bp-40h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 int v64; // [sp+18h] [bp-3Ch]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 unsigned int v65; // [sp+18h] [bp-3Ch]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 unsigned int lPitch; // [sp+20h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 unsigned int lPitcha; // [sp+20h] [bp-34h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 char *lPitchb; // [sp+20h] [bp-34h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 unsigned int v69; // [sp+24h] [bp-30h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 signed int v70; // [sp+24h] [bp-30h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 signed int uBluea; // [sp+28h] [bp-2Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 int v73; // [sp+2Ch] [bp-28h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 unsigned __int8 *v74; // [sp+30h] [bp-24h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 int v76; // [sp+34h] [bp-20h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 int v77; // [sp+34h] [bp-20h]@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 signed int v78; // [sp+38h] [bp-1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 int v79; // [sp+38h] [bp-1Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 signed int a2b; // [sp+40h] [bp-14h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 char *a2c; // [sp+40h] [bp-14h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 int a3a; // [sp+44h] [bp-10h]@40
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13734 signed int uCenterY; // [sp+48h] [bp-Ch]@1
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13735 signed int uCenterX; // [sp+4Ch] [bp-8h]@1
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13736 //signed int uZb; // [sp+5Ch] [bp+8h]@27
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13737 signed int uWidth; // [sp+5Ch] [bp+8h]@30
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 signed int uZd; // [sp+5Ch] [bp+8h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 signed int uZe; // [sp+5Ch] [bp+8h]@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 signed int uZf; // [sp+5Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 signed int uZg; // [sp+5Ch] [bp+8h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 unsigned int uWa; // [sp+60h] [bp+Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 float uWb; // [sp+60h] [bp+Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 unsigned int uWd; // [sp+60h] [bp+Ch]@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 float uZooma; // [sp+64h] [bp+10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 signed int flagsa; // [sp+68h] [bp+14h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 unsigned int flagsb; // [sp+68h] [bp+14h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 char *flagsc; // [sp+68h] [bp+14h]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 unsigned int flagsd; // [sp+68h] [bp+14h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13752 //a3 = uY;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13753 //a2 = uX;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13754 uCenterX = (uX + uZ) / 2;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13755 uCenterY = (uY + uW) / 2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 lPitch = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13759 auto bWizardEyeActive = pParty->WizardEyeActive();
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13760 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13761 if (CheckHiredNPCSpeciality(0x26u))
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13762 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13763 bWizardEyeActive = true;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13764 uWizardEyeSkillLevel = 2;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13765 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13766 pRenderer->Clip_v2(uX, uY, uZ - 1, uW - 1);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13767 uHeight = uW - uY;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13768 uWidth = uZ - uX;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13769
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 v74 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 v62 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 v73 = (1 << (v17 + 16)) / (signed int)uZoom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 v18 = (double)(1 << (16 - v17));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777 v19 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 v20 = (double)(pParty->vPosition.x + 32768) / v18;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13779 v21 = (double)(32768 - pParty->vPosition.y) / v19;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 uWb = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 if ( uZoom == 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13783 v20 = v20 - (double)(uWidth / 2);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13784 v22 = (double)(uHeight / 2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 if ( uZoom == 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13790 v20 = v20 - (double)(uWidth / 4);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13791 v22 = (double)(uHeight / 4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 if ( uZoom != 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 goto LABEL_37;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13797 v20 = v20 - (double)(uWidth / 8);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13798 v22 = (double)(uHeight / 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 uWb = v21 - v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802 LABEL_37:
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13803 //v23 = v20 * 65536.0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13804 //v24 = v23 + 6.7553994e15;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13805 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13806 //uWe = uWb * 65536.0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13807 //v25 = uWe + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 v78 = v70;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13809 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 v26 = (unsigned __int16 *)_56EFD8_minimap;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13811 v27 = uBluea >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 uWc = (unsigned __int16 *)_56EFD8_minimap;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13813 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 if ( flags )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 v64 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13819 if ( uHeight > 0 )
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13820 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13821 a3a = uHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 a2b = 0;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13826 if ( uWidth > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 v30 = (int)&v74[v27 * v64];
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13829 flagsa = uWidth;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13830 a2b = uWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 v31 = uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 ++uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 *v31 = v62[*(char *)(v30 + v29)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 v78 += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 v29 = v78 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 --flagsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 while ( flagsa );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 v78 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 v28 += 137 - a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 uBluea += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 v27 = uBluea >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 --a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 while ( a3a );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 uZd = 117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 v32 = 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 *v28 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 while ( v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 v28 += lPitch - 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 --uZd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 while ( uZd );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 uNumBlueFacesInBLVMinimap = 0;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13870 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13871 else
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13872 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13873 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13874 uNumBlueFacesInBLVMinimap = 0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13875
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13876 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13877 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13878 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i];
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13879
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13880 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13881 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13882 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13883 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13884 if (pFace1->Visible() && pFace2->Visible())
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13885 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13886 v11 = pOutline->uFlags;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13887 if ( v11 & 1 )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13888 goto LABEL_15;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13889 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13890 goto LABEL_ABC;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13891
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13892 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13893 continue;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13894
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13895 LABEL_ABC:
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13896 pOutline->uFlags = v11 | 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13897 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13898
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 LABEL_15:
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13900 //v12 = &pIndoor->pFaces[pOutline->uFace1ID];
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13901 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13902 (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) &&
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13903 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID))
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13904 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13905 if (uNumBlueFacesInBLVMinimap < 49)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13906 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13907 }
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13908 else
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13909 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13910 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13911 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13912 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13913 v69 = uCenterX + _c;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13914 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
13915 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
13916 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
13917 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
13918 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 if ( v15 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920 v15 = 100;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13921 pRenderer->Line2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13922 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13923 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13924
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13925
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13926 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13927 {
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13928 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]];
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13929 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]];
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13930 pRenderer->Line2D(
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13931 uCenterX
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13932 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13933 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934 - uZoom * pParty->vPosition.x) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13935 uCenterY
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13937 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13938 - uZoom * pParty->vPosition.y) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13939 uCenterX
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13941 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13942 - uZoom * pParty->vPosition.x) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13943 uCenterY
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13945 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13946 - uZoom * pParty->vPosition.y) >> 16),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13947 uBlue);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13948 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13949 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13950
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13951
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13952 //_draw_party_arrow:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 v34 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) < 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958 if ( (signed int)v34 <= 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 if ( (signed int)v34 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 if ( (signed int)v34 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 if ( (signed int)v34 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969 if ( (signed int)v34 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 if ( (signed int)v34 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 if ( (signed int)v34 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 v57 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 v57 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 v57 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 v57 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 v57 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001 v35 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002 LABEL_66:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14003 pRenderer->DrawTextureTransparent(
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14004 uCenterX - 3,
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14005 uCenterY - 3,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 (Texture *)(pTextureIDs_pMapDirs[v35] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v35]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14010 if ( bWizardEyeActive )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 uZe = 0;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14013 //for (uint i = 0; i < uNumLayingItems; ++i)
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14014 if (uNumLayingItems > 0)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 a2c = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 if ( !*((short *)a2c - 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 || !*(short *)a2c
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14021 || uWizardEyeSkillLevel == 1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 || (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
14023 + uCenterX,
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14024 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
14025 v38 = uCenterY - v79,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 v37 < pRenderer->field_1C_clipx)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027 || v37 > pRenderer->field_24_clipz
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 || v38 < pRenderer->field_20_clipy
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 || v38 > pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14035 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14036 pRenderer->Line2D(v37, v38 - 2, v37, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14037 pRenderer->Line2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14038 pRenderer->Line2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 v37 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14040 v58 = flagsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14041 v55 = v38 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14044 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, uCenterY - v79, flagsb);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 v58 = flagsb;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14046 v55 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 v53 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 v51 = v38 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 LABEL_82:
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14050 pRenderer->Line2D(v37, v51, v53, v55, v58);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 ++uZe;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 a2c += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 if ( uZe >= (signed int)uNumLayingItems )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14058 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 v58 = v60;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14062 v55 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 v53 = v37;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14065 v51 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 goto LABEL_82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, 0, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14071 v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 uZf = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14073 if ( (signed int)uNumActors > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 flagsc = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 v39 = *(short *)flagsc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 if ( *(short *)flagsc != 11 && v39 != 19 && (v39 == 5 || *(flagsc - 139) & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 v40 = ((unsigned __int64)(((signed int)*((short *)flagsc - 17) - pParty->vPosition.x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 * (signed __int64)(signed int)uZoom) >> 16)
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14083 + uCenterX;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14084 v76 = (unsigned __int64)(((signed int)*((short *)flagsc - 16) - pParty->vPosition.y)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 * (signed __int64)(signed int)uZoom) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14086 v41 = uCenterY - v76;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 if ( v40 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 if ( v40 <= pRenderer->field_24_clipz && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 uWd = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 if ( *(flagsc - 137) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 uWd = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 if ( *(short *)flagsc == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 uWd = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 if ( (signed int)uZoom > 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14098 pRenderer->Line2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14099 pRenderer->Line2D(v40, v41 - 2, v40, v41 + 2, uWd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14100 pRenderer->Line2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 v42 = v41 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 v43 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 v44 = v42;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14104 pRenderer->Line2D(v40 - 2, v43, v40 - 2, v42, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 v40 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 v59 = uWd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 v56 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 v52 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14113 pRenderer->Line2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 v59 = uWd;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14115 v56 = uCenterY - v76;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 v52 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14119 pRenderer->Line2D(v40, v52, v54, v56, v59);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 ++uZf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 flagsc += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 while ( uZf < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 uZg = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 if ( (signed int)uNumLevelDecorations > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14135 v45 = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14136 lPitchb = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 if ( *(v45 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 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
14142 + uCenterX;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14143 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
14144 v47 = uCenterY - v77;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 if ( v46 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 if ( v46 <= pRenderer->field_24_clipz && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 v48 = v47 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 v49 = v47 - 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14153 pRenderer->Line2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14154 pRenderer->Line2D(v46, v49, v46, v48, flagsd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14155 pRenderer->Line2D(v46 + 1, v49, v46 + 1, v48, flagsd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 v45 = lPitchb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14160 pRenderer->Line2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 ++uZg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 v45 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 lPitchb = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 while ( uZg < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 v33,
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14175 (Texture *)(dword_5079D8 != -1 ? &pIcons_LOD->pTextures[dword_5079D8] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 uZooma = (double)pParty->sRotationY * 0.1171875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177 v50 = uZooma + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 LODWORD(v50) + 285,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 0x88u,
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14182 (Texture *)(dword_5079B4 != -1 ? &pIcons_LOD->pTextures[dword_5079B4] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 //----- (00442955) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 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
14189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192 unsigned int *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 unsigned __int8 v8; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 unsigned __int8 v9; // sf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 unsigned int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 __int16 v12; // cx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 signed int v13; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 Vec3_short_ *v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 Vec3_short_ *v18; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 int v19; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 signed int v21; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 int v22; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 Vec3_short_ *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 Vec3_short_ *v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 int v26; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 unsigned __int16 *v27; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 int v28; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 double v30; // st7@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 signed __int64 v31; // qax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 char *v32; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 int v33; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 signed int v34; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 signed int v35; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 int v36; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 int v37; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 int v38; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 unsigned int v39; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 const void *v40; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 unsigned __int16 *v41; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 unsigned __int8 v42; // cf@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 unsigned int v43; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 int v44; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 int v45; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 int v46; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 signed int v47; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 signed int v48; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 int v49; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 signed int v50; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 unsigned int v51; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 int result; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 int v53; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 int v54; // esi@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 int v55; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 __int16 v56; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 double v57; // st7@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 int v58; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 signed __int64 v59; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 signed int v60; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 signed __int64 v61; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 signed int v62; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 signed int v63; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 int v64; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 unsigned int v65; // ebx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 char *v66; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 unsigned __int16 *v67; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 int v68; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 unsigned __int16 v69; // cx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 unsigned int v70; // [sp-10h] [bp-48074h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 unsigned int v71; // [sp-Ch] [bp-48070h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 signed int v73; // [sp-4h] [bp-48068h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 char v75; // [sp+Ch] [bp-48058h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 int v76; // [sp+4800Ch] [bp-58h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 unsigned __int16 *v78; // [sp+48014h] [bp-50h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 unsigned int v79; // [sp+48018h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 unsigned int y_; // [sp+4801Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 int v81; // [sp+48020h] [bp-44h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 unsigned int x_; // [sp+48024h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 int v84; // [sp+4802Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 int v85; // [sp+48030h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 int v86; // [sp+48034h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 int v87; // [sp+48038h] [bp-2Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 int black; // [sp+48040h] [bp-24h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 int v90; // [sp+48044h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 unsigned int i; // [sp+48048h] [bp-1Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 unsigned int v92; // [sp+4804Ch] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 unsigned int v94; // [sp+48054h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 unsigned int v95; // [sp+48058h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 int v96; // [sp+4805Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 const void *v97; // [sp+48060h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 char *a4a; // [sp+4806Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 int a5a; // [sp+48070h] [bp+Ch]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 y_ = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 v85 = (signed int)(x + a4) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 v90 = (signed int)(y + a5) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 v79 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 pRenderer->Clip_v2(x, y, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 v5 = viewparams->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 v6 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 v86 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 v84 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 if ( viewparams->field_2C != 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 if ( viewparams->field_2C == 768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 v5 = 680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 v94 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 v92 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 v93 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 v95 = (unsigned int)pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 v78 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 v87 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 black = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 v96 = 32768 - black - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 v31 = (signed __int64)((double)v96 / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 v32 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 v33 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 v34 = (int)v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 v76 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 if ( v95 && (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 v36 = v95 + v35 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 i = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 v88 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 v37 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 v77 = (unsigned __int16 *)v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 *(short *)v32 = v78[*((char *)v77 + v37)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 v32 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 v97 = (char *)v97 + v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 v37 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 --i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 while ( i );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 v34 += v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 v97 = (const void *)teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 black = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 v32 += 2 * (v94 - v88);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 v97 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 if ( (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 v38 = 2 * (v79 - v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 v39 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 v40 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 v41 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 v42 = v94 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 v43 = v94 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 memcpy(v93, v97, 4 * (v94 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 v45 = (int)((char *)v40 + 4 * v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 v44 = (int)&v41[2 * v43];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 v46 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 v39 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 v93 = (unsigned __int16 *)((char *)v93 + v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 v97 = (char *)v97 + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 while ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 *(short *)v44 = *(short *)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 v45 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 v44 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 --v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 v93 = (unsigned __int16 *)((char *)v93 + v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 v6 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 v86 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 v84 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 v5 = viewparams->field_2C - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14404 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 uNumBlueFacesInBLVMinimap = 0;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14406 v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14407 v9 = (pIndoor->pMapOutlines->uNumOutlines & 0x80000000u) != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 if ( !(v9 | v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 v10 = (int)((char *)v7 + i + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 if ( BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 v12 = *(short *)((char *)v7 + i + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 if ( !(v12 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 if ( !(v96 & 0x80) && (v11 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 v96 = (signed int)v94 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 v13 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 *(short *)(v10 + 10) = v12 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 v14 = *(short *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 v88 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 v15 = &pIndoor->pVertices[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 v16 = v15->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 v17 = v15->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 v93 = (unsigned __int16 *)(v16 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 v92 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 v19 = v18->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 v20 = v18->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 v95 = v19 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 v97 = (const void *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14444 pRenderer->Line2D(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 v85 + v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 v90 - v87,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 v90 - v92,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 black);
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14450 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 ++v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 i += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 while ( (signed int)v94 < (signed int)*v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 v22 = pBlueFacesInBLVMinimapIDs[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 v87 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 v23 = (int)&v7[3 * v22 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 v24 = &pIndoor->pVertices[*(short *)v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 v25 = &pIndoor->pVertices[*(short *)(v23 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 v26 = v25->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 v27 = (unsigned __int16 *)(v24->x - v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 v28 = v24->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 v29 = v25->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 v93 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 v92 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 v97 = (const void *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14478 pRenderer->Line2D(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 v90 - v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 v90 - v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 teal);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 break;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14487 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14493 v81 = pParty->vPosition.y - v84;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14494 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 v49 = v90 - (int)v97 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 if ( v47 >= (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 if ( v47 > (signed int)a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 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
14502 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 v47 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85) < (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14510 v47 = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 if ( v49 >= (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514 if ( v49 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516 if ( v90 - (signed int)v97 - 6 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 v49 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 if ( v90 - (signed int)v97 < (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 v49 = y_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 if ( v48 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14529 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 if ( (signed int)v51 > 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 if ( (signed int)v51 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537 if ( (signed int)v51 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 if ( (signed int)v51 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 if ( (signed int)v51 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 if ( (signed int)v51 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 if ( (signed int)v51 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 v73 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 v73 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 v73 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 v73 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 v73 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 v73 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 v50 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 pRenderer->_4A6776(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 v47,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 v86 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 v94 = (unsigned int)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 if ( *(char *)(v94 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 v53 = *(int *)(v94 + 4) - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 v93 = (unsigned __int16 *)(*(int *)v94 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 v92 = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 v55 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 if ( v54 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 if ( v54 <= pRenderer->field_24_clipz && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 if ( v5 > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 v96 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 black = v55 - 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14609 pRenderer->Line2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14610 pRenderer->Line2D(v54, black, v54, v96, v86);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 v72 = v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 v71 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 v70 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 v72 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 v70 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14623 pRenderer->Line2D(v54, v70, v71, v72, v74);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 ++v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 result = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 v94 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 v90 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 v95 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 v77 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 black = (1 << (v56 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 v57 = (double)(1 << (16 - v56));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 v58 = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 v60 = (int)v59 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 v97 = (const void *)((int)v59 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 v78 = (unsigned __int16 *)(v60 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 v62 = (int)v61 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 teal = v60 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 v63 = (signed __int16)v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 a4a = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 for ( i = result; v85 < (signed int)v95; result = v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 a5a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 v96 = (v63 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 v64 = teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 v81 = (v64 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 if ( !pOutdoor->_47F04C(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 if ( pOutdoor->_47F097(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 if ( !((a5a + v85) % 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 *(short *)a4a = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 *(short *)a4a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 a4a += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 v97 = (char *)v97 + black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 v64 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 ++a5a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 while ( a5a < v90 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 v62 += black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 v97 = (const void *)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 a4a += 2 * (v90 - a5a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 v63 = v62 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 ++v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 teal = (unsigned int)v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 v65 = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 v66 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 if ( (signed int)v95 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 v67 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 result = 2 * (v79 - v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 v68 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 v69 = *(short *)v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 if ( !*(short *)v66 || v69 == (short)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 *v67 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 v66 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 ++v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 --v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 while ( v68 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 v67 = (unsigned __int16 *)((char *)v67 + result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 --v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 while ( v65 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 //----- (00443219) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 int ViewingParams::_443219()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 this->sPartyPosZ += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 //----- (00443225) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 int ViewingParams::_443225()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 this->sPartyPosX -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 //----- (00443231) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 int ViewingParams::_443231()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 this->sPartyPosZ -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 //----- (0044323D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 int ViewingParams::_44323D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 this->sPartyPosX += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 //----- (00443249) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 int ViewingParams::_443249()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 if ( v1 < 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 this->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 this->sPartyPosX = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14758 this->sPartyPosZ = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 //----- (00443291) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 int ViewingParams::_443291()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 v1 = 2 * this->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769 v2 = 1536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 v2 = 3072;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 if ( v1 > v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 this->field_2C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14775 this->sPartyPosX = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14776 this->sPartyPosZ = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 //----- (004432E7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 int ViewingParams::_4432E7()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 int v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 int v7; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 int result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 v2 = this->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 v3 = 88 >> this->field_2C / 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 v4 = (44 - v3) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 if ( v1->sPartyPosZ > v2 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 v1->sPartyPosZ = v2 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 v5 = v1->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799 v6 = (v3 - 44) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 if ( v1->sPartyPosX < v5 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 v1->sPartyPosX = v5 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 v7 = v2 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 if ( v1->sPartyPosZ < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 v1->sPartyPosZ = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 result = v5 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 if ( v1->sPartyPosX > v5 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 v1->sPartyPosX = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 //----- (00443343) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 unsigned int ViewingParams::_443343()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 unsigned __int16 *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 v2 = this->pPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 *v2 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 while ( v1 < 256 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 //----- (00443365) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 int ViewingParams::_443365()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 __int16 *v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 Vec3_short_ *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 unsigned int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 signed int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 Vec3_short_ *v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 signed int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 signed int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 char v9; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 unsigned int v11; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 unsigned int *v12; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 unsigned int v13; // [sp+Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847 unsigned int v14; // [sp+10h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 unsigned int v15; // [sp+14h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 unsigned int v16; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 unsigned int v17; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 _443343();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 v16 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 v14 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 v17 = 0xC0000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 v15 = 0xC0000000u;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14860 if ( (signed int)pIndoor->pMapOutlines->uNumOutlines > 0 )
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14861 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14862 v2 = (__int16 *)(pIndoor->pMapOutlines->pOutlines);
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14863 v11 = pIndoor->pMapOutlines->uNumOutlines;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14864 v12 = (uint *)pIndoor->pMapOutlines->pOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 v3 = &pIndoor->pVertices[*v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 v4 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 if ( (signed int)v4 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 v16 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 if ( (signed int)v4 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 v17 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 v5 = v3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 v13 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 if ( v5 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 v14 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 if ( v5 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 v15 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 v6 = &pIndoor->pVertices[v2[1]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 v7 = v6->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 if ( v7 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 v16 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 if ( v7 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 v17 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 v8 = v6->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 if ( v8 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 if ( v8 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 v15 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890 v2 = (__int16 *)(v12 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 v9 = v11-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 v12 += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 while ( !v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 v1->uMinimapZoom = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897 v1->field_38 = (signed int)(v16 + v17) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 v1->field_28 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 result = (signed int)(v14 + v15) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 v1->field_3A = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 v1->field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 v1->field_3A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 v1->uMinimapZoom = dword_576E2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 result = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 v1->field_28 = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 v1->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 //----- (00443801) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 int __cdecl Initialize2DA()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 const char *v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 _2devent *v1; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 char *v2; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 int v3; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 char v4; // cl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 int v6; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 int v7; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 int result; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 signed int v9; // [sp+10h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 signed int v10; // [sp+14h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930 int it = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 if ( p2DEventsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 pAllocator->FreeChunk(p2DEventsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 p2DEventsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 p2DEventsTXT_Raw = (char *)pEvents_LOD->LoadRaw("2dEvents.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 strtok(p2DEventsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 v1 = p2DEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942 v2 = strtok(0, v0) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 v3 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 v9 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 v4 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 while ( v4 != 9 && v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 v4 = v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 v6 = (int)&v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 if ( !v2[v5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 *(char *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 switch ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 if ( _strnicmp(v2, "wea", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 if ( _strnicmp(v2, "arm", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 if ( _strnicmp(v2, "mag", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 if ( _strnicmp(v2, "alc", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 if ( _strnicmp(v2, "sta", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 if ( _strnicmp(v2, "boa", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 if ( _strnicmp(v2, "tem", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 if ( _strnicmp(v2, "tra", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 if ( _strnicmp(v2, "tow", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 if ( _strnicmp(v2, "tav", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 if ( _strnicmp(v2, "ban", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 if ( _strnicmp(v2, "fir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 if ( _strnicmp(v2, "air", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 if ( _strnicmp(v2, "wat", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 if ( _strnicmp(v2, "ear", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 if ( _strnicmp(v2, "spi", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 if ( _strnicmp(v2, "min", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 if ( _strnicmp(v2, "bod", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 if ( _strnicmp(v2, "lig", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 if ( _strnicmp(v2, "dar", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 if ( _strnicmp(v2, "ele", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 if ( _strnicmp(v2, "sel", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 if ( _strnicmp(v2, "mir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 v7 = -(_strnicmp(v2, "mer", 3u) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 LOBYTE(v7) = v7 & 0xEE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 v1->uType = v7 + 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 v1->uType = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 v1->uType = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 v1->uType = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 v1->uType = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 v1->uType = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 v1->uType = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 v1->uType = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051 v1->uType = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 v1->uType = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 v1->uType = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066 v1->uType = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 v1->uType = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 v1->uType = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 v1->uType = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 v1->uType = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 v1->uType = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 v1->uType = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 v1->uType = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 v1->uType = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 v1->uType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15114 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15116 v1->uType = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 v1->uType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 v1->uType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 v1->uAnimationID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 v1->pName = (char *)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 v1->pProprieterName = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 v1->pProprieterTitle = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142 v1->field_14 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 v1->_state = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 v1->_rep = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 v1->_per = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 v1->fPriceMultiplier = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 v1->flt_24 = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 v1->field_1C = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 v1->uOpenTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 v1->uCloseTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 v1->uExitPicID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 v1->uExitMapID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 v1->_quest_related = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 v1->pEnterText = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 v2 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 v3 = v9 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 result = v3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 while ( v3 + 1 <= 23 && !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 //if ( (signed int)v1 >= (signed int)&unk_597F10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 if (++it >= 525)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 //----- (00443CE1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 unsigned int __fastcall LoadEventsToBuffer(const char *pContainerName, char *a2, unsigned int uBufferSize)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 char Args; // [sp+8h] [bp-B4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 //Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 void *Dst; // [sp+B4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 void *ptr; // [sp+B8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 v3 = pContainerName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 Dst = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 //Texture::Texture(&DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 v4 = pEvents_LOD->FindContainer(v3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 Abortf("Unable to load %s", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 fread(&DstBuf, 1u, 0x30u, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 v5 = DstBuf.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 if ( !DstBuf.uDecompressedSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 v5 = DstBuf.uTextureSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 memset(&DstBuf, 0, 0x48u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 if ( (signed int)v5 >= (signed int)uBufferSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 sprintfex(&Args, "File %s Size %lu - Buffer size %lu", v3, v5, uBufferSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 memcpy(Dst, ptr, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 pAllocator->FreeChunk(ptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 //----- (00443DA1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 void __cdecl Initialize_GlobalEVT()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 char *v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT, 0xB400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 if ( uGlobalEVT_Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 uGlobalEVT_NumEvents = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 memset(pGlobalEVT_Events, 128, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247 v1 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 v2 = (char *)&pGlobalEVT_Events[uGlobalEVT_NumEvents].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 *((int *)v2 - 1) = (unsigned __int8)pGlobalEVT[v0 + 1] + ((unsigned __int8)pGlobalEVT[v0 + 2] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 *(int *)v2 = (unsigned __int8)pGlobalEVT[v0 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 *((int *)v2 + 1) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 v2 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 v0 += (unsigned __int8)pGlobalEVT[v0] + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 while ( v0 < (signed int)uGlobalEVT_Size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 uGlobalEVT_NumEvents = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 //----- (00443E31) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 void __cdecl LoadLevel_InitializeLevelStr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 signed __int16 v0; // si@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15267 //unsigned int v1; // ecx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 int v3; // edx@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15270 //int v4; // eax@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 int v6; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 int v7; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 unsigned int *v8; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 char Args[100]; // [sp+Ch] [bp-68h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 int v10; // [sp+70h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15278 if (sizeof(pLevelStrOffsets) != 0x7D0)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15279 Log::Warning(L"pLevelStrOffsets: deserialization warning");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 memset(pLevelStrOffsets, 0, 0x7D0u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15281
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15282 v0 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15283 //v1 = uLevelStrFileSize;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 v10 = 0;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15287 //v4 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15288 for (uint i = 0; i < uLevelStrFileSize; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15289 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15290 if ( !pLevelStr[i] )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 v5 = (signed __int16)v2++;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15293 pLevelStrOffsets[v5] = i + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15294 if ( (signed __int16)(i - (short)v10) > v0 )
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15295 v0 = i - v10;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15296 v10 = i;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15297 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15298 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15299
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 uLevelStrNumStrings = (signed __int16)v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 if ( v0 > 800 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 sprintfex(Args, "MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 Abortf(Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 if ( (signed __int16)v2 - 1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 v8 = &pLevelStrOffsets[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313 if ( RemoveQuotes(&pLevelStr[*v8]) != &pLevelStr[*v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314 ++*v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15316 v7 = (signed __int16)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 //----- (00443EF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 void __cdecl LoadLevel_InitializeLevelEvt()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 {
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15325 if (!uLevelEVT_Size)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15326 return;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15327
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15328 memset(array_5B5928, 0, 0xC80u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15329 memset(pLevelEVT_Events, 128, 0xCE40u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15330
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15331 uLevelEVT_NumEvents = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15332 dword_5B65C8 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15333
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15334 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15335 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15336 pLevelEVT_Events[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15337 pLevelEVT_Events[i].field_4 = pLevelEVT[j + 3];
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15338 pLevelEVT_Events[i].uEventOffsetInEVT = j;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15339 j += pLevelEVT[j] + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15340
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15341 uLevelEVT_NumEvents++;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15342 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15343 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 //----- (00443F95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 void __cdecl OnMapLeave()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 char *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15350 int v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 if ( (signed int)uLevelEVT_NumEvents > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 v1 = (char *)&pLevelEVT_Events[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15360 v2 = *((int *)v1 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15361 dword_597F18 = *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15362 EventProcessor(v2, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 v1 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368 while ( v0 < (signed int)uLevelEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15371
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 //----- (00443FDC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 void OnMapLoad()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376 stru176 *v3; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377 __int16 v4; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378 __int16 v5; // di@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 signed __int64 v8; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 unsigned int v9; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 signed __int64 v10; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 signed __int64 v11; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 int v12; // ST50_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 signed __int64 v13; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 signed __int64 v14; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 int v15; // ST58_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 signed __int64 v16; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 int v17; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 signed __int64 v19; // [sp+14h] [bp-3Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 int v22; // [sp+2Ch] [bp-24h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 int v24; // [sp+34h] [bp-1Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 int v25; // [sp+38h] [bp-18h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 int v26; // [sp+3Ch] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 int v27; // [sp+3Ch] [bp-14h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 int v28; // [sp+40h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 __int16 v29; // [sp+46h] [bp-Ah]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 __int16 v30; // [sp+48h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 __int16 v31; // [sp+4Ah] [bp-6h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 __int16 v32; // [sp+4Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 __int16 v33; // [sp+4Eh] [bp-2h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15405 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15406 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15407 auto pEvent = pLevelEVT_Events + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15408
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15409 auto _evt = (_evt_raw *)(pLevelEVT + pEvent->uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15410
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15411 if (_evt->v4 == 3)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15412 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15413 pSoundList->_4A9A67(
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15414 _evt->v5 +
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15415 ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15416 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15417 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15418 else if (_evt->v4 == 37)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15419 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15420 dword_597F18 = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15421 EventProcessor(pEvent->uEventID, 0, 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15422 dword_597F18 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15423 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15424 else if (_evt->v4 == 31 || _evt->v4 == 38)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15425 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15426 v3 = &array_5B5928[dword_5B65C8];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15427 v20 = pOutdoor->uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15428 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15429 v20 = pIndoor->stru1.uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15430
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15431 v4 = _evt->v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15432 v3->field_1C = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15433 v3->field_8 = pEvent->uEventID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15434 v3->field_A = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15435 v33 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15436 v3->field_12 = v33;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15437 v32 = _evt->v7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15438 v3->field_14 = v32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15439 v31 = _evt->v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15440 v3->field_16 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15441 v5 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15442 v30 = _evt->v9;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15443 v3->field_18 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15444 v29 = _evt->v10;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15445 v3->field_1A = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15446
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15447 v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15448 v3->field_10 = v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15449 v3->field_C = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15450 v3->field_E = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15451 if ( v4 == 38 && !(short)v6 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15452 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15453 if ( v20 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15454 v18 = pParty->uTimePlayed - v20;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15455 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15456 v18 = 0i64;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15457 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
15458
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15459 if ( v26 / 7 / 4 / 12 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15460 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15461 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15462 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15463 v3->field_4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15464 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15465 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15466 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15467 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15468 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15469 if (v26 / 7 / 4 != 0 && v33 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15470 v26 / 7 != 0 && v32 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15471 v26 != 0 || !v20)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15472 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15473 v3->field_4 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474 ++dword_5B65C8;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15475 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15476 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15477 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15478 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15479
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15480 v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15481 v9 = v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15482 v10 = (signed int)v8 / 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15483 v22 = v10 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15484 v11 = (signed int)(v10 / 60);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15485 v12 = v11 % 24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15486 v13 = (signed int)(v11 / 24);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15487 v27 = v13 % 7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15488 v14 = (signed int)(v13 / 7);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15489 v15 = v14 % 4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15490 v16 = (signed int)(v14 / 4);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15491 v24 = v16 / 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15492
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15493 auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15494 auto _2 = ((__int64)v9 << 32) | _1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15495
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15496 v19 = _2 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15497 //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
15498 // v9)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15499 // % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15500
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15501 v17 = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15502 v25 = v15;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15503 v28 = v16 % 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15504 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15505 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15506 ++v24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15507 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15508 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15509 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15510 if ( v33 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15511 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15512 ++v28;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15514 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15515 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15516 if ( v32 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15517 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15518 ++v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15519 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15520 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15521 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15522 ++v27;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15523 v22 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15524 v17 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15525 v19 = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15526 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15527 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15528 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15529 auto v0 = (signed __int64)((double)((v19
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15530 + 0x3C * v22
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15531 + 0xE10 * v17
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15532 + 0x93A80 * v25
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15533 + 0x15180 * v27
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15534 + 0x24EA00 * (v28 + 12i64 * v24)) << 7)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15535 * 0.033333335);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15536 v3->field_4 = HIDWORD(v0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15537
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15538 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15539 v3->field_0 = v0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15540 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15541 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15542 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15543
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15544 //----- (00444360) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15545 void __thiscall Level_LoadEvtAndStr(const char *pLevelName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15547 char pContainerName[120]; // [sp+8h] [bp-98h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15549 sprintf(pContainerName, "%s.evt", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15551
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15552 sprintf(pContainerName, "%s.str", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15553 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15554 if (uLevelStrFileSize)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15555 LoadLevel_InitializeLevelStr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15558 //----- (004443D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15559 char *__cdecl _4443D5_GetMinimapRightClickText()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 int v0; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 double v3; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15566 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15568 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15569 BSPModel *v8; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 unsigned __int8 v9; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15571 char v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 ODMFace *v12; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574 __int16 v13; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 const char *v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 const char *v15; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578 unsigned int v17; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 unsigned int v18; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 int v19; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 int v20; // [sp+14h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 char *v21; // [sp+18h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583 unsigned int pY; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584 int v23; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585 int v24; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586 int pX; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 v24 = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
15589 v0 = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 v1 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 v18 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 v3 = 1.0 / *(float *)&v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 v23 = pX - 557;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 v17 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 if ( v17 == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 result = "No Maze Info for this maze on file!";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15606 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 result = pMapStats->pInfos[v17].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618 v7 = sub_4621DA(v6, v5, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620 if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622 v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 v9 = pOutdoor->pBModels[v4].uNumFaces == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 v12 = &v8[v4].pFaces[v2 / 0x134u];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 v13 = v12->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15634 if ( !(BYTE2(v12->uAttributes) & 0x10) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 v14 = _444732_GetEventHintString(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15640 if ( _strcmpi(v14, "") )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 v21 = (char *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 v2 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 result = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 if ( v23 >= (signed int)v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 //----- (00444564) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 const char *__cdecl sub_444564()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 double v0; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 int v1; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 int v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 int v5; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 BSPModel *v8; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 unsigned __int8 v9; // zf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 unsigned __int8 v10; // sf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 ODMFace *v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 __int16 v12; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 const char *v13; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 const char *v14; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 const char *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 unsigned int v16; // [sp+0h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 const char *v17; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 unsigned int pY; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 float v19; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 int v20; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 int v21; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 unsigned int v22; // [sp+18h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 int pX; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 v20 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 v21 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 v19 = (double)viewparams->field_2C * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 if ( viewparams->field_2C == 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 v20 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 v21 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 v16 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 v0 = 1.0 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 v1 = (signed __int64)((double)(pX - 229) * v0 + (double)v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 LODWORD(v19) = (signed __int64)((double)v21 - (double)(signed int)(pY - 181) * v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 v2 = abs(v1 + 22528) / 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 v3 = abs((signed)LODWORD(v19) - 22528);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 if ( pOutdoor->_47F04C(v2, v3 / 512)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 && uCurrentlyLoadedLevelType == LEVEL_Outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 && (v4 = 0, v20 = 0, (signed int)v16 > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 pX = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.x + v4) - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 pY = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.y + v4) - LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 v7 = sub_4621DA(v6, v5, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 if ( v7 < *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 v9 = *(unsigned int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 v10 = *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 if ( !(v10 | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 v11 = &(*(ODMFace **)((char *)&v8->pFaces + v4))[v22 / 0x134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 v12 = v11->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15735 if ( !(BYTE2(v11->uAttributes) & 0x10) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 v13 = _444732_GetEventHintString(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15741 if ( _strcmpi(v13, "") )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 v17 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 v22 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 while ( v21 < *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 result = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 v4 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 if ( v20 >= (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 //----- (00444A51) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 char *__cdecl TransitionUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 MapInfo *v0; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 char *v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 std::string v3; // [sp-18h] [bp-84h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 unsigned int v4; // [sp-10h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 int v5; // [sp-Ch] [bp-78h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 const char *v6; // [sp-8h] [bp-74h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 signed int v7; // [sp-4h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 GUIWindow v8; // [sp+Ch] [bp-60h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 unsigned int v9; // [sp+60h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786 unsigned int v10; // [sp+64h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 int a3; // [sp+6Bh] [bp-1h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 memcpy(&v8, pGUIWindow0, sizeof(v8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 uTextureID_507B04 = uTextureID_right_panel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 0x22Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 0x1DCu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 v0 = &pMapStats->pInfos[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 v8.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 v8.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 v8.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 v8.DrawText2(pFontCreate, 0, 5u, 0, v0->pName, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 v8.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 v8.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 v8.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 if ( uCurrentHouse_Animation )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 v1 = (&off_4EB080)[4 * uCurrentHouse_Animation];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 v1 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 }
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15833 v1 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 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
15838 v1 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 v7 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 v6 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 result = v8.DrawText2(pFontCreate, 0, v4, v5, v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 //----- (00444C8F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 GUIWindow *__cdecl UI_CreateTravelDialogue()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 signed int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 unsigned int v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 GUIWindow *result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 const char *v3; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 char pContainer[32]; // [sp+0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 v0 = const_2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 sprintfex(pContainer, "evt%02d", v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 if ( pParty->uAlignment != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 v3 = "-c";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 v3 = "-b";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 strcat(pContainer, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("outside", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 v1 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 sprintfex(byte_591098, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 strcpy(byte_591098, pGlobalTXT_LocalizationStrings[79]);// "Exit"
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15882 result = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)17, 0, (int)byte_591098);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 pDialogueWindow = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 //----- (00444D80) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 signed int __cdecl GetTravelTime()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 v0 = uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 if ( CheckHiredNPCSpeciality(5u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 if ( CheckHiredNPCSpeciality(6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 v0 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 if ( CheckHiredNPCSpeciality(7u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 v0 -= 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 if ( CheckHiredNPCSpeciality(0x2Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 if ( v0 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 // 6BD07C: using guessed type int uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 //----- (00444DCA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 void __cdecl TravelUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 unsigned int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 MapInfo *v1; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 char *v2; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 const char *v5; // [sp-Ch] [bp-90h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 signed int v6; // [sp-8h] [bp-8Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 GUIWindow v7; // [sp+Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 unsigned int v9; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 memcpy(&v7, pGUIWindow0, sizeof(v7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 v9 = pMapStats->GetMapInfo(pCurrentMapName);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
15923 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 v0 = pMapStats->GetMapInfo(pDestinationMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 pRenderer->DrawTextureTransparent(0x1D4u, 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 v1 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 v7.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 v7.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 v2 = v1->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 v7.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 v7.DrawText2(pFontCreate, 0, 4u, 0, v2, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 v7.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 v7.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 v7.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 v3 = GetTravelTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 sprintfex(pTmpBuf, v5, v6, v1->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 v4 = pFontCreate->CalcTextHeight(pTmpBuf, &v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 v7.DrawText2(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 //----- (00444FBE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 void __cdecl DrawBranchlessDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 GUIFont *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 int v1; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 char *v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 int v3; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 char Str[200]; // [sp+Ch] [bp-120h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 GUIWindow v5; // [sp+D4h] [bp-58h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 GUIFont *pFont; // [sp+128h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 v0 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 pFont = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 if ( ptr_F8B1E8 && !byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 strcpy(byte_5B0938, ptr_F8B1E8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 v5.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 v5.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 if ( 352 - v1 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 pFont = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 352 - v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 pRenderer->DrawTextureIndexed(8u, 347 - v1, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 if ( pGUIWindow2->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 if ( pGUIWindow2->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 strcpy(GameUI_StatusBar_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 sub_4452BB();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 if ( pGUIWindow2->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 memset(GameUI_StatusBar_TimedString, 0, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 if ( pGUIWindow2->ptr_1C == (void *)26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 sprintfex(Str, "%s %s", GameUI_StatusBar_TimedString, pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 v3 = pFontLucida->GetLineWidth(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 if ( pKeyActionMap->pPressedKeysBuffer[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 pKeyActionMap->_459ED1(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 //----- (004451A8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 if ( !pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 if ( pParty->uFlags & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 pGame->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 dword_5C3418 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 dword_5C341C = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 _591094_decoration = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16050 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16051 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16052 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16053 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 //----- (004452BB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 void __cdecl sub_4452BB()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 _5C3420_pDecoration = _591094_decoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 dword_597F18 = dword_5C341C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 EventProcessor(dword_5C3418, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 //----- (00445308) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16072 const char *__fastcall sub_445308(int a1)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16073 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 if ( a1 == 10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 || a1 == 11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 || a1 == 12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 || a1 == 33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 || a1 == 34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 || a1 == 39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 || a1 == 40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 || a1 == 41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 || a1 == 42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 || a1 == 43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 || a1 == 52 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16085 return (const char *)*(&pNPCStats->field_13A60 + 5 * a1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16086 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16087 return pNPCTopics[407].pTopic;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16088 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16089
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 //----- (00445350) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 void __cdecl DrawDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 NPCData *v0; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 unsigned __int16 v2; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 int v5; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 char *v6; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 char *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 unsigned int v8; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104 char *v10; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105 int v11; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 int v12; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107 char *v13; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 GUIButton *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 GUIButton *v15; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 signed int v16; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 int v17; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 int v18; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 int v19; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 int v20; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 int v21; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 int v22; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 unsigned int v23; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 const char *v24; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 int v26; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 int v27; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122 int v28; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 unsigned __int16 v30; // cx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 int v31; // ecx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 int v32; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 unsigned int v33; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 GUIWindow *v34; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 int v35; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 int i; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 GUIButton *v37; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 int v38; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 signed int v39; // esi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 signed int v40; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 unsigned int v41; // ebx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 int v42; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 GUIButton *v43; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 int v44; // eax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 unsigned int v45; // ecx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 unsigned __int16 *v46; // edx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 unsigned __int16 v47; // ax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 char pFont; // [sp+4h] [bp-110h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 int v49; // [sp+Ch] [bp-108h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 int v50; // [sp+14h] [bp-100h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 GUIWindow v51; // [sp+58h] [bp-BCh]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 GUIWindow v52; // [sp+ACh] [bp-68h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 char *Str; // [sp+100h] [bp-14h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 __int16 v54[2]; // [sp+104h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 char *pInString; // [sp+110h] [bp-4h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16153 if ( !pDialogueWindow )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 memcpy(&v51, pDialogueWindow, sizeof(v51));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 v51.uFrameWidth -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 v51.uFrameZ -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 *(int *)v54 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 v3 = v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v0->pName, aNPCProfessionNames[v3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 strcpy(pTmpBuf, v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 v51.DrawText2(pFontArrus, 0x1E3u, 0x70u, v2, v4, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 pParty->GetPartyFame();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 if ( (signed int)uDialogueType > 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 if ( uDialogueType == 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 v7 = pGlobalTXT_LocalizationStrings[577]; // "Get back in there you wimps:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 if ( uDialogueType == 91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196 sprintfex(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 pInString = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 if ( uDialogueType == 92 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 if ( uDialogueType == 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 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
16212 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 if ( uDialogueType == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 if ( (signed int)uDialogueType > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 if ( (signed int)uDialogueType > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 if ( uDialogueType == 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 if ( byte_F8B1EC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 pInString = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 if ( byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 goto LABEL_24;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16249 v7 = (char *)ptr_F8B1E8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 if ( *(int *)v54 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 v11 = v0->greet;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 v10 = (char *)*(&pNPCStats->field_17884 + ((v0->uFlags & 3) == 2) + 2 * v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 if ( *(int *)v54 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 pInString = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 if ( v10 == (char *)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 v49 = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 v50 = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 v12 = pFontArrus->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 if ( 352 - v12 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 v12 = pFontCreate->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 352 - v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 v13 = FitTextInAWindow(pInString, pOutString, (GUIWindow *)&pFont, 0xDu, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 memcpy(&v52, pDialogueWindow, sizeof(v52));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 v52.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 v52.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 v52.uFrameZ = 334;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16306 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16307 (signed int)pOutString < v52.pStartingPosActiveItem + v52.pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 pOutString = (GUIFont *)((char *)pOutString + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 v14 = v52.GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 v16 = v14->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 if ( v16 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 v25 = v16 - 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 if ( v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 v27 = v26 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 v28 = v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 if ( v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 v29 = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 if ( v29 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 v24 = pGlobalTXT_LocalizationStrings[581];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 v24 = pGlobalTXT_LocalizationStrings[580];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 v24 = pGlobalTXT_LocalizationStrings[579];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 v24 = pGlobalTXT_LocalizationStrings[578];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 v24 = pGlobalTXT_LocalizationStrings[407];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 v24 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 v24 = pGlobalTXT_LocalizationStrings[406];
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 if ( v16 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 v23 = v0->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 v24 = (&dword_721660)[8 * v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16377 v24 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 v15->uControlParam = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 }
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 v17 = v16 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 v24 = (const char *)sub_445308(v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 v18 = v17 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 v19 = v18 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 v23 = v0->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 v23 = v0->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 v21 = v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 v23 = v0->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 v23 = v0->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 if ( v22 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 v23 = v0->evte;
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 LABEL_71:
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16421 v24 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 v24 = pGlobalTXT_LocalizationStrings[122];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 LABEL_79:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 pInString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
16434 v55 = (unsigned short *)&pActors[0].uAIState;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 *(int *)v54 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 v30 = *v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 ++pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 v55 += 418;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 --*(int *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444 while ( *(int *)v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 if ( pInString == (char *)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 v24 = pGlobalTXT_LocalizationStrings[658];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 strcpy(v15->pButtonName, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 *(int *)v54 = v33;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16456 v35 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16457 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 v37 = v34->GetControl(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16466 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 v32 += v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16469 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16470 v39 = v34->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 pOutString = (GUIFont *)((174 - v32) / v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 if ( (174 - v32) / v39 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 v55 = (unsigned __int16 *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 v40 = 174 - (int)pOutString * v39 - v32;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16478 v41 = v34->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 v42 = v40 / 2 - (signed int)pOutString / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 if ( (signed int)v41 < (signed int)(v41 + v39) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 v43 = v34->GetControl(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 v43->uY = (unsigned int)((char *)pOutString + v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 Str = v43->pButtonName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490 v45 = v43->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491 v46 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492 v43->uHeight = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493 v42 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 v43->uW = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 v47 = v54[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16496 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 v47 = (unsigned __int16)pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 v52.DrawText2(pFontArrus, 0, v45, v47, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 v55 = (unsigned __int16 *)((char *)v55 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16503 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 //----- (004459F9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16513 NPCData *__fastcall GetNPCData(unsigned int npcid)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 int v3; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 int v4; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 int v5; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 NPCData *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 char *v7; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 NPCData *v8; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 char v9; // al@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 std::string v10; // [sp-18h] [bp-2Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 const char *v11; // [sp-8h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 int v12; // [sp-4h] [bp-18h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 std::string *v13; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 int a3; // [sp+13h] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 v1 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 if ( (npcid & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 if ( (signed int)npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 if ( (signed int)npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 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
16538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 return &pNPCStats->pNewNPCData[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 if ( (signed int)npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 if ( v8->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 && (!pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 *v7++ = (char)v13 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 v13 = (std::string *)((char *)v13 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 while ( (signed int)v13 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 v9 = pTmpBuf[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 if ( (unsigned __int8)v9 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 result = &pParty->pHirelings[(unsigned __int8)v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 //----- (00445B2C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 NPCData *v8; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 NPCData *v9; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 int v10; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 char v11; // al@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 std::string v12; // [sp-18h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 const char *v13; // [sp-8h] [bp-24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 int v14; // [sp-4h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 std::string *v15; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 char *v16; // [sp+10h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 int v17; // [sp+14h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 int a3; // [sp+1Bh] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 v2 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 v15 = (std::string *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 if ( npcid >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 if ( npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 if ( npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 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
16619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 *(int *)v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 return &pNPCStats->pNewNPCData[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 *(int *)a2 = npcid - 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 if ( npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 *(int *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 v5 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 v8 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 if ( v8->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643 pTmpBuf[v6++] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 while ( (signed int)v8 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 v9 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 v16 = &pTmpBuf[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 if ( v9->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 v10 = (int)v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 *(char *)v10 = v17 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 while ( v17 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 v3 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 v11 = pTmpBuf[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 if ( (unsigned __int8)v11 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 *(int *)v3 = (unsigned __int8)v11 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 result = &pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[v5] + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 *(int *)v3 = (unsigned __int8)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 result = &pParty->pHirelings[(unsigned __int8)pTmpBuf[v5]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 //----- (00445C8B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 int __fastcall sub_445C8B(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 int v3; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 int v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 NPCData *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 char *v7; // ebp@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 NPCData *v8; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 if ( a1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 if ( a1 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 if ( a1 >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 if ( v8->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 *v7++ = v1 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 while ( v1 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 //----- (0044603D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 void __cdecl sub_44603D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 uDialogue_SpeakingActorNPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 //----- (004465DF) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16747 int sub_4465DF_check_season(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 unsigned int v2; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16751 int v3; // ecx@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 char v6; // zf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 v1 = pParty->uCurrentMonth + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 v2 = pParty->uDaysPlayed + 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16757 if ( a1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16758 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16759 v3 = a1 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16762 v4 = v3 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767 if ( v1 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769 if ( (signed int)v1 >= 1 && (signed int)v1 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 v6 = v1 == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773 if ( !v6 || (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 if ( v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 if ( (signed int)v1 >= 10 && (signed int)v1 <= 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 v6 = v1 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 if ( v1 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 if ( (signed int)v1 >= 7 && (signed int)v1 <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 v6 = v1 == 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 if ( v1 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 if ( (signed int)v1 >= 4 && (signed int)v1 <= 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 v6 = v1 == 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 if ( (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 //----- (0044665D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 // uType: 0 -> any monster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 // 1 -> uParam is GroupID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 // 2 -> uParam is MonsterID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 // 3 -> uParam is ActorID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 // uNumAlive: 0 -> all must be alive
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 unsigned int uAliveActors; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 int v5; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 unsigned int uTotalActors; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 uTotalActors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 if ( uType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 if ( uType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 uAliveActors = SearchActorByGroup(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 if ( uType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 uAliveActors = SearchActorByMonsterID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 if ( uType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 uAliveActors = SearchActorByID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 uAliveActors = SearchAliveActors(&uTotalActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 if ( uNumAlive )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 LOBYTE(v5) = (signed int)uAliveActors >= (signed int)uNumAlive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 LOBYTE(v5) = uTotalActors == uAliveActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 //----- (004466C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 bool __thiscall sub_4466C4(void *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 char *v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 signed int v8; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 Player *v10; // [sp+8h] [bp-10h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 signed int v11; // [sp+Ch] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 signed int v12; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 void *v13; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 if ( !_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 v3 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 pSomeOtherEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 memcpy(pSomeOtherEVT_Events, pGlobalEVT_Events, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 if ( (signed int)uSomeOtherEVT_NumEvents <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 if ( (void *)pSomeOtherEVT_Events[v1].uEventID == v13 && pSomeOtherEVT_Events[v5].field_4 == v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 v6 = pSomeOtherEVT_Events[v5].uEventOffsetInEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 v7 = &pSomeOtherEVT[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 v10 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 v8 = (unsigned __int8)v7[7]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 + (((unsigned __int8)v7[8] + (((unsigned __int8)v7[9] + ((unsigned __int8)v7[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 LOBYTE(v9) = v10->CompareVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 (enum VariableType)((unsigned __int8)pSomeOtherEVT[v6 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 + ((unsigned __int8)pSomeOtherEVT[v6 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 if ( (signed int)v10 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 v12 = (unsigned __int8)v7[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] != 52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 || !IsActorAlive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 (unsigned __int8)v7[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 (unsigned __int8)v7[6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 + (((unsigned __int8)v7[7] + (((unsigned __int8)v7[8] + ((unsigned __int8)v7[9] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 (unsigned __int8)v7[10]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 v1 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 v3 = (unsigned __int8)pSomeOtherEVT[v6 + 11] - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 while ( v1 < (signed int)uSomeOtherEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 result = v12 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 result = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 //----- (0044684A) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16955 void __fastcall EventProcessor(int uEventID, int a2, int a3)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 unsigned int v3; // eax@5
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16958 //signed int v4; // esi@7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16959 //char *v5; // eax@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16960 Player *v6; // ecx@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16961 //char *v7; // ebp@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16962 //signed int v8; // edx@10
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16963 //int v9; // edi@12
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16964 //ByteArray *v10; // esi@12
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 int v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 char *v12; // eax@15
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16967 //char *v13; // edi@21
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 int v14; // ebp@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 int v15; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 const char *v16; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 bool v17; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 int v18; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 int v19; // ebp@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 signed int v20; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 int v21; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 int v22; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 int v23; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 unsigned __int16 v24; // ax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 int v25; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 LevelDecoration *v26; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 int v28; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 int v30; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 int v31; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 int v32; // esi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 NPCData *v33; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 int v34; // esi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 int v35; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 int v36; // esi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 int v37; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 int v38; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 int v39; // ecx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 size_t v40; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 char *v41; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 int v42; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 int v43; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 size_t v44; // edx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 char *v45; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 void *v46; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 GUIWindow *v47; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 GUIButton *v48; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 GUIButton *v49; // esi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 char v50; // al@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 Player *v51; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 Player *v52; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 int v53; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 char v54; // al@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 Player *v55; // esi@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 Player *v56; // ecx@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 int v57; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 signed int v58; // ebp@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 Player *v59; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 int v60; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 int v61; // edx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 int v62; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 void *v63; // ebp@145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 signed int v64; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 unsigned int v65; // edx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 Player *v66; // ecx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 int v67; // esi@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 signed int v68; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 int v69; // esi@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 Player *v70; // ecx@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 unsigned int v71; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 int v72; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 signed int v73; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 int v74; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 int v75; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 Player *v76; // esi@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 signed int v77; // ebp@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032 int v78; // edx@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 Player *v79; // esi@187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 signed int v80; // ebp@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 int v81; // edx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 Player *v82; // esi@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 int v83; // eax@212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 int v84; // ebp@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 signed int v85; // ebp@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 char v86; // al@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 Player *v87; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 Player *v88; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 int v89; // ecx@232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 int v90; // eax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 const char *v91; // ecx@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 int v92; // eax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 char *v93; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 int v94; // ecx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 int v95; // ebp@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 int v96; // edx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 int v97; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 unsigned int v98; // edx@265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 const char *v99; // esi@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 int v100; // edx@267
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17055 //char *v101; // edi@281
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 unsigned int v102; // esi@281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 int v103; // edi@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 int v104; // eax@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 int v105; // edx@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 int v106; // [sp-20h] [bp-4C8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 signed int v107; // [sp-1Ch] [bp-4C4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 unsigned int v108; // [sp-18h] [bp-4C0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 signed int v109; // [sp-14h] [bp-4BCh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 signed int v110; // [sp-10h] [bp-4B8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 int v111; // [sp-Ch] [bp-4B4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 Event *v112; // [sp-8h] [bp-4B0h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 int v113; // [sp-8h] [bp-4B0h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 int v114; // [sp-8h] [bp-4B0h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 signed int v115; // [sp-8h] [bp-4B0h]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 unsigned int v116; // [sp-8h] [bp-4B0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 int v117; // [sp-4h] [bp-4ACh]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072 int v118; // [sp-4h] [bp-4ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 int v119; // [sp-4h] [bp-4ACh]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 int v120; // [sp-4h] [bp-4ACh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 int v121; // [sp-4h] [bp-4ACh]@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 int v122; // [sp+10h] [bp-498h]@4
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17077 //char *v123; // [sp+14h] [bp-494h]@0
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17078 //signed int v124; // [sp+18h] [bp-490h]@7
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 signed int v125; // [sp+1Ch] [bp-48Ch]@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 int v126; // [sp+1Ch] [bp-48Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 int v127; // [sp+20h] [bp-488h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 int v128; // [sp+24h] [bp-484h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 int v129; // [sp+24h] [bp-484h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 signed int v130; // [sp+28h] [bp-480h]@0
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17085 //int v131; // [sp+2Ch] [bp-47Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 int v132; // [sp+30h] [bp-478h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 signed int v133; // [sp+34h] [bp-474h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 int v134; // [sp+38h] [bp-470h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 int v135; // [sp+3Ch] [bp-46Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090 int v136; // [sp+40h] [bp-468h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 int v137; // [sp+44h] [bp-464h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 int v138; // [sp+48h] [bp-460h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 int v139; // [sp+4Ch] [bp-45Ch]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 ItemGen item; // [sp+50h] [bp-458h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 char Source[120]; // [sp+74h] [bp-434h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 char Str[120]; // [sp+ECh] [bp-3BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 Actor Dst; // [sp+164h] [bp-344h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17099 //v131 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 dword_5B5920 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102 dword_5B65C4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 v127 = 2 * (uActiveCharacter == 0) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 v122 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 v3 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 pSomeEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 v112 = pGlobalEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 v3 = uLevelEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 pSomeEVT = pLevelEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 v112 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 uSomeEVT_NumEvents = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 memcpy(pSomeEVT_Events, v112, 0xCE40u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17125 //v4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17126 //v124 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17127 for (uint i = 0; i < uSomeEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17128 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17129 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17130 //v6 = v123;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
17131 //v7 = "";
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17132 //while ( 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17133 //{
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 if ( dword_5B65C4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 goto LABEL_301;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17136 //v8 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17137 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
17138 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17139 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17140 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17141 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17142
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17143 switch (_evt->v4)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 case EVENT_CheckSeason:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17146 if ( !sub_4465DF_check_season(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17148 v11 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 case EVENT_ShowMovie:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17151 strcpy(Source, (char *)&_evt->v7);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 if ( *v12 == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 *v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 if ( pVideoPlayer->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17157 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17158 pVideoPlayer->field_40 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17159 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17160 pAsyncMouse->Suspend();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17161 v128 = pCurrentScreen;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17162 //v13 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17163 //v14 = (unsigned __int8)v13[5];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17164 //v15 = (unsigned __int8)v13[6];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17165 v14 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17166 v15 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167 strcpy(Str, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17168 v16 = RemoveQuotes(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 VideoPlayer::MovieLoop(v16, 0, v14, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 if ( !_strcmpi(v16, "arbiter good") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 pParty->uAlignment = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17176 SetUserInterface(v18, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17179 if ( !_strcmpi(v16, "arbiter evil") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17181 v18 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 pParty->uAlignment = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17183 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 if ( !_strcmpi(v16, "pcout01") ) // moving to harmondale from emerald isle
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 Rest(0x2760u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 pParty->RestAndHeal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 pParty->field_764 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 if ( !v15 || v128 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17194 pCurrentScreen = v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 if ( v128 == 3 )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
17196 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 if ( v128 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17200 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 case EVENT_CheckSkill:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17204 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17209 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17211 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17213 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17215 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17217 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17221 v20 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17222 v21 = 3486 * v130 + _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 v137 = v21 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17226 v138 = v21 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 v22 = v21 & 0x100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 v23 = v21 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 v139 = v22;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17230 while ( v23 < v19 || !*(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 if ( v20 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 LABEL_50:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17237 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 LABEL_47:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17241 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17242 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 v137 = v24 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 v138 = v24 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 v139 = v24 & 0x100;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17249 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 case EVENT_SpeakNPC:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 if ( a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 //Actor::Actor(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 memset(&Dst, 0, 0x344u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17257 dword_5B65D0_dialogue_actor_npc_id = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17258 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17259 + ((_evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17260 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 Dst.InitializeDialogue(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17266 bDialogueUI_InitializeActor_NPC_ID = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17267 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 case EVENT_ChangeEvent:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17271 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17274 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = _evt->v5 - 124;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17276 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 v26 = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 LOBYTE(v26->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 case EVENT_SetNPCGreeting:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17284 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17285 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 pNPCStats->pNewNPCData[v27].greet = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 case EVENT_SetNPCTopic:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17290 v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17291 v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17292 v31 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17293 v32 = _evt->v9;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 v33 = &pNPCStats->pNewNPCData[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17295 if ( v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 v34 = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 v35 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17301 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 v36 = v35 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 if ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 v37 = v36 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17309 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17310 v33->evtf = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 v33->evte = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 v33->evtd = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 v33->evtc = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 v33->evtb = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 v33->bDrawSomeAnim = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 if ( v29 == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 if ( v30 == 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 if ( EnterHouse((enum HOUSE_TYPE)170) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 pAudioPlayer->StopChannels(-1, -1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17346 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17347 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17348 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17349 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17350 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17351 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17352 ptr_F8B1E8 = pNPCTopics[90].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 case EVENT_NPCSetItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 sub_448518_npc_set_item(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17359 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17360 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17361 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 case EVENT_SetActorItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17364 Actor::GiveItem(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17365 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17366 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17367 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369 case EVENT_SetNPCGroupNews:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17370 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
17371 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 case EVENT_SetActorGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17373 __debugbreak();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17374 *(&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
17375 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 case EVENT_ChangeGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17377 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17378 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 v40 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17380 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17383 v41 = (char *)&pActors[0].uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17384 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 if ( *(int *)v41 == v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17387 *(int *)v41 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 v41 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 --v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 while ( v40 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17394 case EVENT_ChangeGroupAlly:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17395 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17396 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 v44 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17398 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 v45 = (char *)&pActors[0].uAlly;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 if ( *((int *)v45 - 1) == v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 *(int *)v45 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 v45 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 --v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 while ( v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17412 case EVENT_MoveNPC:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17413 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
17414 if ( ptr_507BC0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 v46 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 if ( v46 == (void *)165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 _5C3420_pDecoration = (LevelDecoration *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 if ( EnterHouse((enum HOUSE_TYPE)165) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17427 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 ptr_507BC0 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 v48 = v47->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17430 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 v49 = v48->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 pAllocator->FreeChunk(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 v48 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 while ( v49 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 v47 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 v47->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 ptr_507BC0->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 ptr_507BC0->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 if ( v46 == (void *)553 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 pVideoPlayer->bLoopPlaying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 case EVENT_Jmp:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17454 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17455 v122 = _evt->v5 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 case EVENT_ShowFace:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17458 v50 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 if ( (unsigned __int8)v50 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17462 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 v53 = (unsigned __int8)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 if ( v50 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17469 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 v52 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 goto LABEL_109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 if ( v50 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17475 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17476 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 v53 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 LABEL_108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 v52 = &pParty->pPlayers[v53];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 LABEL_109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 v52->PlayEmotion(v113, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 v51 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17487 v51->PlayEmotion(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 while ( (signed int)v51 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 LABEL_291:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 ++v122;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17493 //v4 = v124;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17494 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17495 //v6 = v123;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
17496 //v7 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 case EVENT_CharacterAnimation:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17499 v54 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 if ( (unsigned __int8)v54 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17503 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17504 v57 = (unsigned __int8)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 if ( v54 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17510 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17511 v56 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 if ( v54 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17516 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17517 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 v57 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 v56 = &pParty->pPlayers[v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 LABEL_120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 v56->PlaySound(v114, v118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 v55 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17528 v55->PlaySound(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 while ( (signed int)v55 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 case EVENT_ForPartyMember:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17534 v127 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 case EVENT_SummonItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 sub_42F7EB_DropItemAt(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17538 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17539 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17540 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17541 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17542 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17543 _evt->v25,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17544 _evt->v26,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17545 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 case EVENT_Compare:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17549 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 v59 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17556 LOBYTE(v60) = v59->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17557 (enum VariableType)(_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17558 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17559 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17560 if ( v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17561 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 ++v130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17563 ++v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 if ( (signed int)v59 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17567 LABEL_129:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17568 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17569 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17571 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17572 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17573 v61 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17574 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17575 goto LABEL_137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17576 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17578 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17579 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17580 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17581 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17586 if ( v127 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17587 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17589 v61 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17590 //v5 = pSomeEVT;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17591 LABEL_137:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17592 v6 = &pParty->pPlayers[v61];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17593 LABEL_138:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17594 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17595 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17596 LOBYTE(v62) = ((Player *)v6)->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17597 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17598 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17599 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17600 if ( v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17601 goto LABEL_129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17602 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17603 case EVENT_IsActorAlive:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17604 v62 = IsActorAlive(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17605 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17606 _evt->v6 + ((_evt->v7 + ((_evt->v8 + ((uint)_evt->v9 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17607 _evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17608 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17609 case EVENT_Substract:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17610 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
17611 if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17613 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17614 if ( (void *)pParty->pPickedItem.uItemID == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17616 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17617 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17619 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17620 v66 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17621 v67 = (int)v66->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17622 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17623 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17624 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17626 v66->RemoveItemAtInventoryIndex(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17627 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17629 ++v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17630 v67 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17632 while ( (signed int)v65 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17633 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17634 v69 = (int)&v66->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17635 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17636 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17637 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17639 *(&v66->pEquipment.uOffHand + v68) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17640 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17642 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17643 v69 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17645 while ( v68 < 16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17646 v125 = (signed int)&pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17647 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17649 v70 = *(Player **)v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17650 if ( !v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17652 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17653 v72 = (int)v70->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17654 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17655 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17656 if ( *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17658 v70->RemoveItemAtInventoryIndex(v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17659 goto LABEL_169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17661 ++v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17662 v72 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17664 while ( (signed int)v71 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17665 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17666 v74 = (int)&v70->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17667 while ( !*(int *)v74
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17668 || *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17670 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17671 v74 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17672 if ( v73 >= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17673 goto LABEL_170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17675 *(&v70->pEquipment.uOffHand + v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17676 LABEL_169:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17677 v64 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17679 LABEL_170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17680 v125 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17681 if ( v125 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17682 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17685 v75 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17686 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17688 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17689 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17690 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17692 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17694 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17695 goto LABEL_180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17696 LABEL_183:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17697 ((Player *)v6)->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17698 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17699 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17700 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17702 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17703 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17704 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17705 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17707 LABEL_180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17708 v75 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17709 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17710 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17711 v6 = &pParty->pPlayers[v75];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17712 LABEL_182:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17713 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17714 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17716 v76 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17717 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17718 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17720 v76->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17721 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17722 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17723 ++v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17725 while ( (signed int)v76 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17726 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17727 case EVENT_Set:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17728 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17729 v78 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17730 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17732 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17733 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17734 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17736 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17738 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17739 goto LABEL_194;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17740 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17741 ((Player *)v6)->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17742 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17743 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17744 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17746 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17747 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17748 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17749 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17751 LABEL_194:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17752 v78 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17753 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17754 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17755 v6 = &pParty->pPlayers[v78];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17756 LABEL_196:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17757 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17758 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17760 v79 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17761 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17762 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17764 v79->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17765 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17766 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17767 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17769 while ( (signed int)v79 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17770 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17771 case EVENT_Add:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17772 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17773 v81 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17774 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17776 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17777 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17778 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17780 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17782 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17783 goto LABEL_208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17784 LABEL_211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17785 ((Player *)v6)->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17786 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17787 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17788 goto LABEL_212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17790 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17791 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17792 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17793 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17795 LABEL_208:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17796 v81 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17797 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17798 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17799 v6 = &pParty->pPlayers[v81];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17800 LABEL_210:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17801 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17802 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17804 v82 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17805 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17806 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17808 v82->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17809 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17810 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17811 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17813 while ( (signed int)v82 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17814 LABEL_212:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17815 v83 = _evt->v5 + ((uint)_evt->v6 << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17816 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17817 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17818 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17819 case EVENT_InputString:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17820 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17822 strcpy(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17823 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17824 &pLevelStr[pLevelStrOffsets[_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17825 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17826 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17827 v105 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17828 v121 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17829 LABEL_295:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17830 sub_4451A8_press_any_key(uEventID, v105, v121);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17831 LABEL_301:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17832 if ( v133 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17833 LABEL_302:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17834 OnMapLeave();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17835 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17836 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17837 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17838 if ( !_strcmpi(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17839 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17840 &pLevelStr[pLevelStrOffsets[_evt->v9
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17841 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17842 || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17843 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17844 v11 = _evt->v17;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17845 LABEL_130:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17846 //v124 = -1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17847 LABEL_131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17848 v122 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17850 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17851 case EVENT_RandomGoTo:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17852 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17853 v11 = (unsigned __int8)*(&_evt->v5
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17854 + rand()
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17855 % ((_evt->v5 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17856 + (_evt->v6 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17857 + (_evt->v7 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17858 + (_evt->v8 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17859 + (_evt->v9 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17860 + (_evt->v10 != 0)));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17861 goto LABEL_131;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17862 case EVENT_ReceiveDamage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17863 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17864 v86 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17865 if ( (unsigned __int8)v86 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17866 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17867 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17868 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17869 v89 = (unsigned __int8)v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17870 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17872 if ( v86 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17874 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17875 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17876 v119 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17877 v88 = pPlayers[uActiveCharacter];
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17878 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17879 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17881 if ( v86 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17882 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17883 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17884 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v1 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17885 v89 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17886 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17887 v88 = &pParty->pPlayers[v89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17888 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17889 v88->ReceiveDamage(v115, v119);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17890 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17892 v87 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17893 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17894 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17895 v87->ReceiveDamage(v85, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17896 ++v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17898 while ( (signed int)v87 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17899 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17900 case EVENT_ToggleIndoorLight:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17901 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17902 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17903 case EVENT_SetFacesBit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17904 sub_44892E_set_faces_bit(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17905 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17906 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17907 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17908 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17909 case EVENT_ToggleChestFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17910 Chest::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17911 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17912 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17913 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17914 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17915 case EVENT_ToggleActorFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17916 Actor::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17917 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17918 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17919 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17920 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17921 case EVENT_ToggleActorGroupFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17922 ToggleActorGroupFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17923 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17924 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17925 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17926 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17927 case EVENT_SetSnow:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17928 if ( !_evt->v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17929 pWeather->bRenderSnow = _evt->v6 != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17930 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17931 case EVENT_StatusText:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17932 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17933 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17935 if ( _5C3420_pDecoration == (LevelDecoration *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17937 ptr_F8B1E8 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17938 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17940 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17942 v91 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17943 LABEL_248:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17944 ShowStatusBarString(v91, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17945 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17948 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17950 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17952 v91 = &pLevelStr[pLevelStrOffsets[v90]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17953 goto LABEL_248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17956 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17957 case EVENT_ShowMessage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17958 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17959 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17961 v93 = (&dword_721664)[8 * v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17962 byte_5B0938[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17963 ptr_F8B1E8 = v93;
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 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17969 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17970 case EVENT_CastSpell:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17971 sub_448DF8_cast_spell(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17972 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17973 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17974 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17975 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17976 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17977 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17978 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17979 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17980 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17981 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17982 case EVENT_SetTexture:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17983 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
17984 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17985 case EVENT_SetSprite:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17986 SetDecorationSprite(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17987 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17988 _evt->v9,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17989 (char *)&_evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17990 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17991 case EVENT_SummonMonsters:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17992 sub_448CF4_spawn_monsters(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17993 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17994 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17995 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17996 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17997 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17998 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17999 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18000 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18001 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18002 case EVENT_MouseOver:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18003 case EVENT_LocationName:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18004 --v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18005 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18006 case EVENT_ChangeDoorState:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18007 sub_449A49_door_switch_animation(_evt->v5, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18008 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18009 case EVENT_OpenChest:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18010 if ( !Chest::Open(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18011 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18012 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18013 case EVENT_MoveToMap:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18014 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18015 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18016 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18017 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18018 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18019 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18020 v96 = _evt->v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18021 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18022 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18023 if ( _evt->v29 || _evt->v30 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18025 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18026 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18027 sub_444839_move_map(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18028 _evt->v29,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18029 _evt->v30,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18030 v135,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18031 v132,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18032 v126,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18033 v129,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18034 v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18035 v134,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18036 (char *)&_evt->v31);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18037 dword_5C3418 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18038 dword_5C341C = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18039 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18040 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18041 _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
18042 _5B65A8_npcdata_uflags_or_other = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18043 _5B65B0_npcdata_rep_or_other = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18044 if ( v129 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18046 v98 = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18048 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18050 v98 = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18051 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18052 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18053 v99 = (char *)&_evt->v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18054 _5B65B8_npcdata_hiword_house_or_other = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18055 dword_5B65BC = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18056 v100 = v94 | v132 | v126 | v95 | v97 | v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18057 dword_5B65C0 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18058 if ( *v99 == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18060 if ( v100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18062 pParty->vPosition.x = v135;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18063 pParty->vPosition.y = v132;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18064 pParty->vPosition.z = v126;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18065 pParty->uFallStartY = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18066 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18067 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18068 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18069 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18070 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18071 v111 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18072 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18073 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18074 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18075 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18076 pParty->sRotationX = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18077 pParty->uFallSpeed = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18078 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18079 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18080 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18081 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18082 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18083 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18084 v106 = 232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18085 LABEL_280:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18086 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18089 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18090 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18091 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18092 sub_44987B(v99, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18093 v133 = 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18094 if ( pCurrentScreen == 13 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18096 if ( uGameState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18098 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18099 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18100 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18101 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18102 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18103 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18104 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18105 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18106 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18107 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18108 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18109 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18110 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18111 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18112 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18113 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18115 goto LABEL_302;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18118 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18119 case EVENT_PlaySound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18120 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18121 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18122 v111 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18123 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18124 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18125 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18126 v107 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18127 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18128 goto LABEL_280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18129 case EVENT_GiveItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18130 item.Reset();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18131 //v101 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18132 v102 = _evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18133 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18134 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18135 if ( v102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18136 item.uItemID = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18137 pParty->SetHoldingItem(&item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18138 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18139 case EVENT_SpeakInHouse:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18140 v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18141 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
18142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18143 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18144 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18145 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18146 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18147 v104 = 187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18148 if ( uCurrentHouse_Animation != 167 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18149 v104 = v103;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
18150 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18151 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18152 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18153 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18154 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18155 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18157 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18158 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18159 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18160 case EVENT_PressAnyKey:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18161 v121 = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18162 v105 = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18163 goto LABEL_295;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18164 case EVENT_Exit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18165 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18167 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18168 //++v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18169 //v124 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18170 //if ( v4 >= (signed int)uSomeEVT_NumEvents )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18171 //goto LABEL_301;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18172 //}
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18175
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18178 //----- (0044861E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18179 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18181 unsigned int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18182 unsigned __int16 v3; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18183 signed int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18184 BLVFace *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18185 unsigned int *v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18186 char *v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18187 int v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18188 char *v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18189 ODMFace *v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18190 unsigned int *v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18191 unsigned __int16 v12; // [sp+Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18192 const char *Str2; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18193 unsigned int v14; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18194 signed int v15; // [sp+18h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18195 int v16; // [sp+1Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18196 signed int v17; // [sp+20h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18197 signed int v18; // [sp+20h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18199 Str2 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18200 v14 = uFaceCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18201 if ( uFaceCog )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18203 v2 = pBitmaps_LOD->LoadTexture(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18204 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18205 v12 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18206 if ( v2 != -1 ? (int)&pBitmaps_LOD->pTextures[v2] : 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18207 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
18208 pBitmaps_LOD->pTextures[v2].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2].palette_id1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18210 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18212 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18213 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18215 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18216 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18218 if ( pIndoor->pFaceExtras[v4].sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18220 v5 = &pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18221 if ( BYTE1(v5->uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18223 pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18224 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18225 v6 = (unsigned int *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18226 if ( *(_WORD *)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18228 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18230 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18232 *(_WORD *)v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18233 v7 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18234 v7[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18237 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18239 v5->uBitmapID = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18242 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18243 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18245 while ( v17 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18247 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18251 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18252 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18254 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18255 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18257 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18258 v9 = (char *)&pOutdoor->pBModels[v16].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18259 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18260 if ( (signed int)pOutdoor->pBModels[v16].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18262 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18264 v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18265 if ( v10->sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18266 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
18267 if ( BYTE1(v10->uAttributes) & 0x40 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18269 *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18270 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18271 v11 = (unsigned int *)(*((_DWORD *)v9 + 4) + v8 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18272 if ( *(_WORD *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18274 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18276 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18278 *(_WORD *)v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18279 *(_BYTE *)(*((_DWORD *)v9 + 4) + v8 + 29) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18282 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18284 v10->uTextureID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18287 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18288 v8 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18290 while ( v18 < *((_DWORD *)v9 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18292 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18293 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18295 while ( v15 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18298 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18302
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18304
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18305
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18306 //----- (0044882F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18307 void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18309 signed int v3; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18310 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18311 unsigned __int16 v5; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18312 unsigned int v6; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18313 int v7; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18315 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18316 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18317 v6 = uCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18318 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18320 v4 = (char *)&pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18321 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18323 if ( *((_WORD *)v4 + 9) == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18325 if ( pFileName && _strcmpi(pFileName, "0") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18327 v5 = pDecorationList->GetDecorIdByName(pFileName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18328 *((_WORD *)v4 - 1) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18329 pDecorationList->InitializeDecorationSprite((signed __int16)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18331 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18332 *v4 &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18333 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18334 *v4 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18335 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18337 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18338 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18340 while ( v3 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18344
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18345 //----- (004488B6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18346 unsigned __int16 DecorationList::GetDecorIdByName(const char *pName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18348 DecorationList *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18349 signed int uID; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18350 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18351 unsigned __int16 result; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18353 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18354 if ( pName && (uID = 1, (signed int)this->uNumDecorations > 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18356 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18357 while ( _strcmpi(pName, v2->pDecorations[v4].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18359 ++uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18360 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18361 if ( uID >= (signed int)v2->uNumDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18362 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18364 result = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18366 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18368 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18369 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18371 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18373
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18374
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18375 //----- (0044892E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18376 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18378 signed int v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18379 signed int v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18380 char *v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18381 int v6; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18382 char *v7; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18383 signed int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18384 ODMFace *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18385 int v10; // [sp+0h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18386 signed int v11; // [sp+4h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18387 int v12; // [sp+8h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18388
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18389 v10 = sCogNumber;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18390 if ( sCogNumber )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18392 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18393 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18395 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18397 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18398 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18400 if ( pIndoor->pFaceExtras[v4].sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18402 v5 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18403 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18404 *(_DWORD *)v5 |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18405 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18406 *(_DWORD *)v5 &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18408 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18409 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18411 while ( v3 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18413 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18415 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18417 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18418 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18420 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18421 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18423 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18424 v7 = (char *)&pOutdoor->pBModels[v12].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18425 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18426 if ( (signed int)pOutdoor->pBModels[v12].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18428 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18430 v9 = (ODMFace *)(v6 + *((_DWORD *)v7 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18431 if ( v9->sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18433 if ( on )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
18434 v9->uAttributes |= bit;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18435 else
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
18436 v9->uAttributes &= ~bit;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18438 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18439 v6 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18441 while ( v8 < *((_DWORD *)v7 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18443 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18444 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18446 while ( v11 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18449 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18452
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18453
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18454 //----- (00448A17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18455 void Chest::ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18457 unsigned __int16 *pFlags; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18458
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18459 if ( (uChestID & 0x80000000u) == 0 && (signed int)uChestID <= 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18461 pFlags = &pChests[uChestID].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18462 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18463 *pFlags |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18464 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18465 *pFlags &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18468
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18469 //----- (00448A40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18470 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18472 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18474 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18476 pActors[uActorID].uAttributes |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18478 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18480 if ( uFlag == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18481 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
18482 if (pActors[uActorID].uAIState == Disabled )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
18483 pActors[uActorID].uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18485 pActors[uActorID].uAttributes &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18489
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18490 //----- (00448A98) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18491 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18493 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18494 unsigned int v4; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18495 signed int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18496 char *v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18497 size_t v7; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18498 char *v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18499 unsigned __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18501 v4 = uGroupID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18502 v5 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18503 v3 = uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18504 if ( uGroupID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18506 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18508 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18510 v6 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18511 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18513 if ( *((_DWORD *)v6 + 168) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18515 *(_DWORD *)v6 |= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18516 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18518 *((_WORD *)v6 + 70) = Disabled;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18519 ((Actor *)(v6 - 36))->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18522 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18523 v6 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18525 while ( v5 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18528 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18530 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18531 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18533 v8 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18534 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18536 if ( *((_DWORD *)v8 + 133) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18538 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18540 v9 = *(_WORD *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18541 if ( *(_WORD *)v8 != Dead )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18543 if ( v9 != 4 && v9 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18544 *(_WORD *)v8 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18547 *((_DWORD *)v8 - 35) &= ~v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18549 v8 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18550 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18552 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18558
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18559 //----- (00448B45) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18560 void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18562 if ( bForceHide || GameUI_StatusBar_TimedStringTimeLeft && GetTickCount() >= GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18563 GameUI_StatusBar_TimedStringTimeLeft = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18565
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18566 //----- (00448B67) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18567 void __thiscall OnTimer(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18569 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18570 unsigned int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18571 unsigned int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18572 char *v4; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18573 __int16 v5; // ax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18574 int v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18575 unsigned int v7; // ebp@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18576 int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18577 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18578 unsigned __int64 v10; // qax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18579 int v11; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18580 int v12; // [sp+Ch] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18581 unsigned int v13; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18583 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18584 if ( !pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18586 if ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18587 dword_5773C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18588 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18589 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18590 v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18591 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18593 _5773B8_event_timer = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18594 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18595 if ( dword_5B65C8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18597 v4 = (char *)&array_5B5928[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18598 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18600 v5 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18601 if ( *(short *)v4 != (short)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18602 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18603 v7 = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18604 if ( v7 <= v3 && (v7 < v3 || *((int *)v4 - 3) <= v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18606 if ( *((short *)v4 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18608 v8 = 29030400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18610 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18612 if ( *((short *)v4 + 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18614 v8 = 2419200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18616 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18618 v9 = -(*((short *)v4 + 4) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18619 v8 = (v9 & 0x7E900) + 86400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18622 v10 = __PAIR__(v7, *((int *)v4 - 3)) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18623 *((int *)v4 - 3) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18624 *((int *)v4 - 2) = HIDWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18625 if ( HIDWORD(v10) <= v3 && (HIDWORD(v10) < v3 || *((int *)v4 - 3) < v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18627 *((int *)v4 - 3) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18628 *((int *)v4 - 2) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18630 v11 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18631 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18632 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18633 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18634 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18635 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18636 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18638 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18639 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18640 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18641 if ( v12 >= dword_5B65C8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18642 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18643 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18645 if ( v13 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18647 *(short *)v4 = v5 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18648 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18650 v6 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18651 *(short *)v4 = *((short *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18652 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18653 EventProcessor(v6, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18654 dword_597F18 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18655 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18660
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18661 //----- (00481D77) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18662 void _outdoor_project(RenderVertexSoft *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18664 double v1; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18665 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18666
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18667 v1 = 1.0 / (v->vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18668 v->flt_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18669 v2 = v1 * (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18670 v->vWorldViewProjX = (double)pViewport->uScreenCenterX - v2 * v->vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18671 v->vWorldViewProjY = (double)pViewport->uScreenCenterY - v2 * v->vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18675 //----- (00448CF4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18676 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
18677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18678 __int16 v8; // di@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18679 __int16 v9; // si@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18680 unsigned int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18681 size_t v11; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18682 signed int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18683 char *v13;//Actor_uYawAngle_cr *v13; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18684 AIDirection a3; // [sp+Ch] [bp-50h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18685 AIDirection v15; // [sp+28h] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18686 //SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18687
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18688 v8 = typeindex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18689 v9 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18691 SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18692 //SpawnPointMM7::SpawnPointMM7(&v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18694 v16.vPosition.x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18695 v16.vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18696 v16.vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18697 v16.uGroup = group;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18698 v16.uRadius = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18699 v16.uKind = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18700 v16.uIndex = v8 + 2 * v9 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18701 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18702 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18704 v11 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18705 SpawnEncounter((MapInfo *)&pMapStats + v10, &v16, 0, count, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18706 memcpy(&v15, Actor::GetDirectionInfo(8 * v11 | AI_OBJECT_ACTOR, 4u, &a3, 1), sizeof(v15));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18707 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18708 if ( (signed int)v11 < (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18710 v13 = (char *)&pActors[v11].uYawAngle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18711 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18713 ((Actor *)((char *)v13 - 154))->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18714 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18715 *(short *)v13/*->uYawAngle*/ = LOWORD(v15.uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18716 *(int *)(v13+666)/*->dword_000334_unique_name*/ = uUniqueName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18717 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18719 while ( v12 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18723
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18724
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18725 //----- (00448DF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18726 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
18727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18728 int v9; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18729 double v10; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18730 double v11; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18731 double v12; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18732 double v13; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18733 int v14; // ST44_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18734 signed int v15; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18735 signed int v16; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18736 char *v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18737 unsigned __int16 v18; // ax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18738 char *v19; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18739 int v20; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18740 signed int v21; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18741 char *v22; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18742 unsigned __int16 v23; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18743 int i; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18744 signed int v25; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18745 char *v26; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18746 unsigned __int16 v27; // ax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18747 int j; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18748 signed int v29; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18749 char *v30; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18750 unsigned __int16 v31; // ax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18751 char *v32; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18752 unsigned __int16 v33; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18753 int v34; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18754 int v35; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18755 unsigned __int64 v36; // qax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18756 SpellBuff *v37; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18757 int v38; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18758 signed __int64 v39; // qax@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18759 int v40; // ebx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18760 int v41; // ebx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18761 int v42; // esi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18762 int v43; // ebx@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18763 int v44; // eax@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18764 unsigned __int16 v45; // si@137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18765 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18766 int v47; // [sp-4h] [bp-B8h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18767 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18768 int v49; // [sp+0h] [bp-B4h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18769 int v50; // [sp+0h] [bp-B4h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18770 int v51; // [sp+4h] [bp-B0h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18771 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18772 float v53; // [sp+14h] [bp-A0h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18773 float v54; // [sp+18h] [bp-9Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18774 int v55; // [sp+28h] [bp-8Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18775 unsigned int yaw; // [sp+30h] [bp-84h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18776 int pitch; // [sp+34h] [bp-80h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18777 //LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18778 int v59; // [sp+A8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18779 int v60; // [sp+ACh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18780 int spellnum_; // [sp+B0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18781 signed int levela; // [sp+BCh] [bp+8h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18782 int a6_4; // [sp+C8h] [bp+14h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18783 float a7a; // [sp+CCh] [bp+18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18784 signed int a7b; // [sp+CCh] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18785 int a7c; // [sp+CCh] [bp+18h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18786 int a7d; // [sp+CCh] [bp+18h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18787 float a8a; // [sp+D0h] [bp+1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18788 int a8b; // [sp+D0h] [bp+1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18789 int a8c; // [sp+D0h] [bp+1Ch]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18790 float toza; // [sp+D4h] [bp+20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18791
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18792 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18793 v59 = rank + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18794 spellnum_ = spellnum;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18795 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18796 if ( tox || toy || toz )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18798 v10 = (double)tox - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18799 v53 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18800 v11 = (double)toy - (double)fromy;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18801 v54 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18802 v12 = (double)toz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18804 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18806 v10 = (double)pParty->vPosition.x - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18807 v53 = v10;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18808 v11 = (double)pParty->vPosition.y - (double)fromy;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18809 v54 = v11;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18810 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18812 a7a = v12 - (double)fromz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18813 toza = v11 * v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18814 a8a = v10 * v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18815 v13 = sqrt(a7a * a7a + a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18816 if ( v13 <= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18818 LOBYTE(v55) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18819 yaw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18820 pitch = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18822 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18824 v55 = (signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18825 v14 = (signed __int64)sqrt(a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18826 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18827 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18829 v15 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18830 if ( v59 <= 0 || v59 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18831 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18832 a7b = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18833
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18834 LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18835 //LayingItem::LayingItem(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18836
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18837 a1.uItemType = stru_4E3ACC[spellnum_].uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18838 if ( spellnum_ > 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18840 if ( spellnum_ == 69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18841 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18842 if ( spellnum_ != 83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18843 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18844 v40 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18845 if ( v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18847 v41 = v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18848 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18850 v42 = 14400 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18851 v43 = 4 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18852 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18854 if ( v41 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18856 v42 = 18000 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18857 v43 = 5 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18858 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18861 v42 = 10800 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18862 v43 = 3 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18863 LABEL_114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18864 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18865 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18866 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18867 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18868 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18869 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18870 v48 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18871 v46 = a7b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18872 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18873 v37 = &pParty->pPartyBuffs[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18874 LABEL_115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18875 v36 = pParty->uTimePlayed + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18876 LABEL_116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18877 v37->Apply(v36, v46, v48, v50, v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18878 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18880 if ( spellnum_ != 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18882 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18884 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18885 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18886 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18887 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18888 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18889 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18890 case 39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18891 case 41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18892 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18893 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18894 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18895 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18896 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18897 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18898 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18899 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18900 while ( (short)a1.uItemType != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18902 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18903 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18904 if ( v16 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18905 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18907 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18908 v18 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18909 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18910 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18911 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18913 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18914 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18915 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18916 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18917 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18918 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18919 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18920 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18921 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18922 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18923 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18924 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18926 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18927 if ( v60 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18929 a8b = a7c / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18930 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18931 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18932 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18933 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18934 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18935 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18937 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18938 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18940 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18942 v22 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18943 while ( (short)a1.uItemType != *(short *)v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18945 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18946 v22 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18947 if ( v21 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18948 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18950 v23 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18952 a1.uObjectDescID = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18953 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18954 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18955 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18956 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18957 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18958 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18959 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18960 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18961 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18962 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18964 a1.uFacing = i + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18965 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18966 (signed __int16)(i + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18967 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18968 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18969 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18971 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18973 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18974 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18975 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18976 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18977 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18978 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18979 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18980 v19 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18981 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18983 if ( (short)a1.uItemType == *(short *)v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18984 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18985 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18986 v19 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18988 while ( v16 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18989 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18990 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18991 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18992 a1.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18993 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18994 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18995 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18996 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18997 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18998 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18999 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19000 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19001 a1.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19002 a1.uFacing = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19003 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19004 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19005 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19006 v47 = pitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19007 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19008 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19009 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19011 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19012 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19013 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19014 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19015 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19016 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19017 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19018 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19019 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19020 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19021 v60 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19022 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19024 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19025 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19026 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19027 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19028 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19029 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19030 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19031 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19032 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19033 v26 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19034 while ( (short)a1.uItemType != *(short *)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19036 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19037 v26 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19038 if ( v25 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19040 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19041 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19042 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19045 v27 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19046 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19047 a1.uObjectDescID = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19048 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19049 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19050 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19051 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19052 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19053 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19054 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19055 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19056 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19057 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19059 a1.uFacing = j + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19060 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19061 (signed __int16)(j + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19062 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19063 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19064 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19066 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19067 case 43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19068 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19069 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19070 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19071 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19072 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19073 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19074 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19075 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19076 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19077 v30 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19078 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19079 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19080 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19082 if ( v15 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19084 v9 = 60 * (level + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19086 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19088 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19090 v9 = 180 * (level + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19092 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19094 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19095 v9 = 240 * (level + 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19099 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19100 v32 = (char *)&pParty->pPlayers[0].pConditions[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19101 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19103 if ( *(_QWORD *)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19104 levela = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19105 v32 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19107 while ( (signed int)v32 < (signed int)&pParty->pHirelings[0].uFlags );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19108 if ( !levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19109 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19110 pParty->pPartyBuffs[8].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19111 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19112 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19113 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19114 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19115 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19116 v33 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19117 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19118 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19119 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19120 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19121 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19122 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19123 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19124 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19125 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19127 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19128 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19129 v9 = 300 * (level + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19130 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19131 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19132 v9 = 900 * (level + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19133 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19134 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19135 v9 = 3600 * (level + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19136 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19138 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19140 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19141 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19142 level = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19143 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19144 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19145 v35 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19146 level = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19147 v60 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19148 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19149 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19150 v34 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19151 level = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19152 v60 = v34;
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 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19156 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19157 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19158 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19159 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19160 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19161 v48 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19162 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19163 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19164 v37 = &pParty->pPartyBuffs[level];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19165 goto LABEL_116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19166 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19167 if ( v15 == 2 || v15 == 3 || v15 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19168 v38 = 60 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19170 v38 = 600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19171 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19172 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19173 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19174 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19175 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19176 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19177 v48 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19178 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19179 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19180 v37 = &pParty->pPartyBuffs[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19181 goto LABEL_115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19182 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19183 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19184 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19185 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19186 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19187 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19188 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19190 while ( (short)a1.uItemType != *(short *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19192 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19193 v30 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19194 if ( v29 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19196 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19197 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19198 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19201 v31 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19202 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19203 a1.uObjectDescID = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19204 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19205 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19206 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19207 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19208 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19209 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19210 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19211 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19212 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19213 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19214 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19215 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19216 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19217 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19218 a1.Create(v20, v47, v49, v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19219 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19221 LABEL_117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19222 v44 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19223 a6_4 = 3600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19224 if ( v15 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19226 LABEL_124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19227 v60 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19228 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19230 if ( v15 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19232 v44 = 2 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19233 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19235 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19237 v44 = 3 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19238 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19240 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19242 v44 = 4 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19243 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19245 LABEL_125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19246 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19248 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19249 level = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19250 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19251 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19252 level = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19253 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19254 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19255 level = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19256 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19257 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19258 level = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19259 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19260 case 58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19261 level = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19262 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19263 case 69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19264 level = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19265 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19267 v45 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19268 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19269 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19270 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19271 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19272 pParty->pPartyBuffs[level].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19273 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19274 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19275 v60,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19276 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19277 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19278 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19279 LABEL_138:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19280 if ( levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19281 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19282 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19284 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19286 //----- (0044987B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19287 char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19289 const char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19290 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19291 char *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19292
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19293 v2 = pMapName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19294 v3 = uStartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19295 pAudioPlayer->StopChannels(-1, -1);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19296 pGameLoadingUI_ProgressBar->_443484((GUIProgressBar::Type)0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19297 if ( _strcmpi(pCurrentMapName, v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19298 SaveGame(1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19299 uGameState = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19300 result = strcpy(pCurrentMapName, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19301 uLevel_StartingPointType = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19302 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19304 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19305
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19306 //----- (004498D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19307 void __thiscall TeleportToStartingPoint(unsigned int uPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19309 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19310 int v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19311 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19312 unsigned __int16 v4; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19313 signed int v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19314 LevelDecoration *v6; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19315 signed int v7; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19316 int v8; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19317 int v9; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19318 const char *v10; // [sp-4h] [bp-84h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19319 char pName[128]; // [sp+8h] [bp-78h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19321 if ( uPointType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19323 v1 = uPointType - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19324 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19326 v2 = v1 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19327 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19329 v3 = v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19330 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19332 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19333 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19334 v10 = "West Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19336 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19338 v10 = "East Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19341 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19343 v10 = "South Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19346 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19348 v10 = "North Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19351 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19353 v10 = "Party Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19355 strcpy(pName, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19356 v4 = pDecorationList->GetDecorIdByName(pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19357 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19359 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19360 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19362 v6 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19363 while ( v6->uDecorationDescID != (signed __int16)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19365 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19366 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19367 if ( v5 >= (signed int)uNumLevelDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19368 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19370 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19371 pParty->vPosition.x = pLevelDecorations[v7].vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19372 pParty->vPosition.y = pLevelDecorations[v7].vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19373 pParty->vPosition.z = pLevelDecorations[v7].vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19374 pParty->uFallStartY = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19375 v8 = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[v7].field_1A) / 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19376 v9 = pLevelDecorations[v7].field_10_y_rot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19377 pParty->sRotationY = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19378 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19379 pParty->sRotationY = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19380 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19381 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19383 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19384 if ( dword_5B65C0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19386 if ( _5B65A8_npcdata_uflags_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19387 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19388 if ( _5B65AC_npcdata_fame_or_other )
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19389 pParty->vPosition.y = _5B65AC_npcdata_fame_or_other;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19390 if ( _5B65B0_npcdata_rep_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19391 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19392 pParty->vPosition.z = _5B65B0_npcdata_rep_or_other;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19393 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19395 if ( _5B65B4_npcdata_loword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19396 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19397 if ( _5B65B8_npcdata_hiword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19398 pParty->sRotationX = _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19399 if ( dword_5B65BC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19400 pParty->uFallSpeed = dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19402 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19403 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19404 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19405 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19406 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19407 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19408 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19411 // 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19412 // 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19413 // 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19414 // 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19415 // 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19416 // 5B65BC: using guessed type int dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19417 // 5B65C0: using guessed type int dword_5B65C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19419 //----- (00449A49) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19420 __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19422 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19423 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19424 signed int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19425 int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19426 BLVDoor *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19427 unsigned int v7; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19428 signed int v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19429 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19430 char Args; // [sp+Ch] [bp-78h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19432 LOWORD(v2) = LOWORD(pIndoor->pDoors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19433 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19434 if ( !pIndoor->pDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19435 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19436 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19437 v5 = (int)&pIndoor->pDoors->uDoorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19438 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19440 if ( *(int *)v5 == uDoorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19441 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19442 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19443 v5 += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19445 while ( v4 < 200 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19446 if ( v4 >= 200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19448 sprintfex(&Args, "Unable to find Door ID: %i!", uDoorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19449 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19451 v6 = &pIndoor->pDoors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19452 if ( v3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19454 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19455 if ( (short)v2 == 3 || (short)v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19456 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19457 if ( (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19458 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19460 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19462 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19464 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19465 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19466 if ( (short)v2 && (short)v2 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19467 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19468 v6->uState = BLVDoor::Closing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19469 if ( (short)v2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19471 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19472 v6->uTimeSinceTriggered = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19473 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19475 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19476 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19477 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19479 v8 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19480 v9 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19481 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19482 v2 = (v6->uMoveLength << 7) / v8 - ((signed int)(v7 * v9) / 128 << 7) / v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19483 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19485 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19487 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19489 if ( v3 != 1 )
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 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19493 if ( (short)v2 != 2 && (short)v2 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19494 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19495 v6->uState = BLVDoor::Opening;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19496 if ( !(short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19497 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19498 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19499 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19500 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19502 v8 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19503 v9 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19504 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19506 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19507 v6->uTimeSinceTriggered = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19509 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19511
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19512 //----- (00449B57) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19513 unsigned int __fastcall _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19515 return a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19518 //----- (00449B7E) --------------------------------------------------------
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19519 unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19521 signed int v3; // esi@1
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19522 unsigned char *result; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19523 unsigned int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19524
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19525 v3 = a2 - 1;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19526 result = &pArray[v3 / 8];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19527 v5 = 0x80 >> v3 % 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19528 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19529 *result |= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19530 else
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19531 *result &= ~(unsigned char)v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19532 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19534
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19536 //----- (0044A56A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19537 void __cdecl sub_44A56A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19539 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19540 NPCData *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19541
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19542 pParty->field_70A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19543 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19544 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19546 v1 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19547 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19549 if ( v1->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v1->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19551 if ( !pParty->pHirelings[1].pName || strcmp(v1->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19552 ++pParty->field_70A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19554 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19555 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19557 while ( v0 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19560
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19562 //----- (0044C175) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19563 void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19565 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19566 int i; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19567
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19568 v2 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19569 strcpy(GameUI_StatusBar_TimedString, pString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19570 GameUI_StatusBar_TimedStringTimeLeft = 1000 * v2 + GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19571 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19572 i > 450;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19573 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19574 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19576
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19577 //----- (0044C1D0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19578 void __cdecl ShowNothingHereStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19580 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19581 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19585 //----- (0044C28B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19586 signed int __cdecl const_2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19588 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19591 //----- (0044C28F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19592 bool __cdecl sub_44C28F_open_nwc_dungeon()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19594 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19595
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19596 result = _strcmpi("nwc.blv", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19597 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19599 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19600 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19601 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19602 _5B65B4_npcdata_loword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19603 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19604 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19605 dword_5B65C0 = 0;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19606 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19607 sub_44987B("nwc.blv", 0);
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
19608 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19609 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19611 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19612 }
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19613
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19615 //----- (0044C2F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19616 int LevelDecoration::IsInteractive()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19618 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19620 v1 = this->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19621 if ( v1 > 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19623 if ( v1 == 184 || v1 == 187 || v1 == 190 || v1 > 205 && v1 <= 221 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19624 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19626 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19628 if ( v1 == 34 || v1 >= 4 && (v1 <= 6 || v1 == 11 || v1 > 12 && (v1 <= 14 || v1 == 24)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19629 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19631 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19633
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19634 //----- (0044C362) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19635 void Vec3_int_::Normalize_float()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19637 Vec3_int_ *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19638 double v2; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19639 float v3; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19640 double v4; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19641 float v5; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19642 double v6; // st4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19643 float v7; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19644 float v8; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19645 float v9; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19646 double v10; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19647 float v11; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19648 double v12; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19649 float v13; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19650 double v14; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19651
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19652 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19653 v2 = (double)this->x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19654 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19655 v4 = (double)this->y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19656 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19657 v6 = (double)this->z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19658 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19659 v8 = 1.0 / sqrt(v6 * v6 + v4 * v4 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19660 v9 = v8 * v3 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19661 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19662 v1->x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19663 v11 = v8 * v5 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19664 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19665 v1->y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19666 v13 = v8 * v7 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19667 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19668 v1->z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19670
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19671 //----- (0044C448) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19672 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19674 GUIFont *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19675 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19676 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19677 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19678 unsigned __int16 **v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19679 GUIFont *v7; // [sp+4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19680 int v8; // [sp+8h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19681 unsigned __int16 **v9; // [sp+Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19683 result = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19684 v3 = pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19685 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19686 v7 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19687 if ( pFontPalette )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19689 v4 = &pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19690 v9 = result->pFontPalettes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19691 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19693 v5 = pIcons_LOD->LoadTexture(v3, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19694 if ( v5 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19695 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
19696 sprintf(pTmpBuf, "Unable to open %s", v3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19697 Abortf(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19699 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19700 v6 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19701 v3 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19702 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19703 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19704 *v6 = (v5 != -1 ? pIcons_LOD->pTextures[v5].pPalette16 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19706 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19707 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19709 result->field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19710 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19716 //----- (0044C768) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19717 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19719 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19720 GUIFont *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19721 unsigned int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19722 int v9; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19723 unsigned __int8 v10; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19724 int v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19725 GUICharMetric *v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19726 int v13; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19727 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19728 int v15; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19729 unsigned int v16; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19730 unsigned int v17; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19731 unsigned int v18; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19732 int v19; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19733 unsigned __int8 v20; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19734 char v21; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19735 unsigned __int8 v22; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19736 int v23; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19737 unsigned __int8 v24; // dl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19738 int v25; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19739 int v26; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19740 std::string v27; // [sp-18h] [bp-40h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19741 const char *v28; // [sp-8h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19742 int v29; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19743 const char *v30; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19744 char Str[3]; // [sp+10h] [bp-18h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19745 char v32; // [sp+13h] [bp-15h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19746 size_t v33; // [sp+14h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19747 unsigned int v34; // [sp+18h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19748 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19749 int v36; // [sp+20h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19750 int v37; // [sp+24h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19751
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19752 v5 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19753 v6 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19754 v30 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19755 v35 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19756 if ( !pInString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19758 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19759 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19761 v33 = strlen(pInString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19762 strcpy(pTmpBuf3, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19763 v8 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19764 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19765 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19766 v34 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19767 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19768 if ( (signed int)v33 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19770 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19772 v10 = pTmpBuf3[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19773 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19774 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19775 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19776 v11 = v10 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19777 v12 = &v6->pMetrics[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19778 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19780 strncpy(Str, &pTmpBuf3[v9 + 1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19781 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19782 v26 = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19783 v8 = uX + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19784 v25 = v9 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19785 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19786 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19788 v13 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19789 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19790 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19791 v14 = v13 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19792 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19794 v25 = v9 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19795 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19796 v37 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19797 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19799 v15 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19800 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19802 if ( v15 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19804 v16 = v12->uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19805 v17 = v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19806 v18 = v12->uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19807 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19809 if ( v37 > v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19810 v8 += v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19811 v8 += v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19812 if ( v37 < (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19813 v8 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19814 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19816 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19818 v19 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19819 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19820 v22 = __OFSUB__(v36, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19821 v20 = v36 == v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19822 v21 = v36 - v37 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19823 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19824 pTmpBuf3[v36] = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19825 v23 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19826 if ( (unsigned __int8)(v21 ^ v22) | v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19828 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19830 v24 = pTmpBuf3[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19831 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19833 if ( v23 > v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19834 v8 += v6->pMetrics[v24].uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19835 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19836 if ( v23 < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19837 v8 += v6->pMetrics[v24].uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19839 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19841 while ( v23 <= v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19844 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19846 v8 += v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19847 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19849 if ( !a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19850 return (char *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19851 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19852 v9 = v37++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19853 if ( v37 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19854 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19856 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19857 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19858 v36 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19859 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19861 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19864
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19865
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19866
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19868
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19869
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19870
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19871
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19874 //----- (00401000) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19875 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19877 void *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19878 int v5; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19879
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19880 if ( numObjs - 1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19882 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19883 v5 = numObjs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19884 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19886 constructor((int)v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19887 v4 = (char *)v4 + objSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19888 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19890 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19893
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19895 //----- (004014E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19896 int __cdecl ODM_4014E6_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19898 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19899 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19900 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19901 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19902 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19903 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19904 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19905 unsigned int v7; // ST20_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19906 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19907 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19908 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19909 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19910 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19911 int result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19912 int v14; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19913 int v15; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19914 int v16; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19915 unsigned int *v17; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19916 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19917 int i; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19918 char *v20; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19919 int v21; // [sp+Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19920 int v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19921 int v23; // [sp+14h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19922 int v24; // [sp+14h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19923 signed int v25; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19924 signed int v26; // [sp+18h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19925 int v27; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19926
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19927 pParty->uFlags &= 0xFFFFFFCFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19928 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19929 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19930 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19932 v0 = (int)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19933 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19935 *(char *)(v0 + 1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19936 if ( ! ((Actor *)(v0 - offsetof(Actor, uAttributes)))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19937 goto LABEL_37;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19938 v22 = abs(pParty->vPosition.z - *(short *)(v0 + 110));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19939 v21 = abs(pParty->vPosition.y - *(short *)(v0 + 108));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19940 v1 = abs(pParty->vPosition.x - *(short *)(v0 + 106));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19941 v2 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19942 v3 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19943 if ( v1 < v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19945 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19946 v1 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19947 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19949 if ( v1 < v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19951 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19952 v1 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19953 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19955 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19957 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19958 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19959 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19961 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19962 v8 = *(short *)(v0 + 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19963 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19964 v23 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19965 if ( v23 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19967 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19968 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19970 if ( v9 < 5632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19972 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19973 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19974 if ( v10 & 0x80000 || ((Actor *)(v0 - offsetof(Actor, uAttributes)))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19976 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19977 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19978 if ( v11 && (double)v23 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19979 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19980 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19981 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19983 *(char *)(v0 + 1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19984 v12 = v27++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19985 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19986 ai_array_4F7DB0_actor_ids[v12] = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19988 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19990 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19991 *(char *)(v0 + 1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19993 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19994 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19996 while ( v25 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19998 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19999 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20001 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20002 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20003 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20004 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20006 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20008 v24 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20009 if ( v15 >= result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20010 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20011 v16 = ai_array_4F75E0[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20012 if ( v16 > ai_array_4F75E0[v15] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20014 v17 = &ai_array_4F7DB0_actor_ids[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20015 v18 = ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20016 ai_array_4F7DB0_actor_ids[v14] = *v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20017 *v17 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20018 v15 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20019 ai_array_4F75E0[v14] = ai_array_4F75E0[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20020 ai_array_4F75E0[v24] = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20022 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20023 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20025 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20026 v15 = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20027 v26 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20029 while ( v15 - 1 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20031 ai_arrays_size = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20032 if ( result > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20034 result = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20035 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20037 for ( i = 0; i < result; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20039 v20 = (char *)&pActors[ai_array_4F7DB0_actor_ids[i]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20040 v20[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20042 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20044 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20046 //----- (004016FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20047 int __cdecl BLV_4016FA_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20049 char *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20050 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20051 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20052 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20053 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20054 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20055 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20056 unsigned int v7; // ST24_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20057 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20058 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20059 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20060 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20061 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20062 int v13; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20063 int v14; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20064 int v15; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20065 unsigned int *v16; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20066 unsigned int v17; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20067 int v18; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20068 signed int v19; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20069 Actor *v20; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20070 bool v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20071 int v22; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20072 signed int v23; // ebx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20073 char *v24; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20074 signed int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20075 int v26; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20076 int v27; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20077 int j; // edi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20078 unsigned int v29; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20079 int v30; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20080 int v31; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20081 int v32; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20082 signed int v33; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20083 __int64 v34; // qax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20084 char *v35; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20085 int v37; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20086 int v38; // [sp+10h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20087 int v39; // [sp+14h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20088 int v40; // [sp+18h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20089 int v41; // [sp+18h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20090 int i; // [sp+18h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20091 signed int v43; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20092 signed int v44; // [sp+1Ch] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20093 int v45; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20094
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20095 pParty->uFlags &= 0xFFFFFFCFu;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20096 v37 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20097 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20098 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20099 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20101 v0 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20102 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20104 v0[1] &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20105 if ( ! ((Actor *)(v0 - 36))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20106 goto LABEL_60;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20107 v39 = abs(pParty->vPosition.z - *((short *)v0 + 55));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20108 v38 = abs(pParty->vPosition.y - *((short *)v0 + 54));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20109 v1 = abs(pParty->vPosition.x - *((short *)v0 + 53));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20110 v2 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20111 v3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20112 if ( v1 < v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20114 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20115 v1 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20116 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20118 if ( v1 < v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20120 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20121 v1 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20122 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20124 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20126 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20127 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20128 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20130 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20131 v8 = *((short *)v0 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20132 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20133 v40 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20134 if ( v40 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20136 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20137 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20139 if ( v9 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20141 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20142 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20143 if ( v10 & 0x80000 || ((Actor *)(v0 - 36))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20145 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20146 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20147 if ( v11 && (double)v40 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20148 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20149 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20150 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20152 v12 = v45++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20153 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20154 ai_array_4F7DB0_actor_ids[v12] = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20156 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20158 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20159 v0[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20161 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20162 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20164 while ( v43 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20166 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20167 if ( v45 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20169 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20170 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20171 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20173 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20175 v41 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20176 if ( v14 >= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20177 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20178 v15 = ai_array_4F75E0[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20179 if ( v15 > ai_array_4F75E0[v14] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20181 v16 = &ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20182 v17 = ai_array_4F7DB0_actor_ids[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20183 ai_array_4F7DB0_actor_ids[v13] = *v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20184 *v16 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20185 v14 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20186 ai_array_4F75E0[v13] = ai_array_4F75E0[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20187 ai_array_4F75E0[v41] = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20189 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20191 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20192 v14 = v44 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20193 v44 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20195 while ( v14 - 1 < v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20197 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20198 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20199 for ( i = 0; v18 < v45; i = v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20201 v20 = &pActors[ai_array_4F7DB0_actor_ids[v18]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20202 if ( v20->uAttributes & 0x8000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20203 || (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
20204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20205 v22 = ai_array_4F7DB0_actor_ids[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20206 v20->uAttributes |= 0x8000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20207 ai_array_4F6638_actor_ids[v19] = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20208 ai_array_4F5E68[v19++] = ai_array_4F75E0[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20209 if ( v19 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20210 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20212 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20214 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20215 ai_arrays_size = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20216 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20218 v24 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20219 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20221 if ( ((Actor *)(v24 - 36))->CanAct() && *((short *)v24 + 61) == v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20223 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20224 if ( v19 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20226 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20227 v26 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20228 v24[1] |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20229 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20230 ai_array_4F6638_actor_ids[v26] = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20232 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20234 while ( ai_array_4F6638_actor_ids[v25] != v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20236 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20237 if ( v25 >= v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20238 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20242 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20243 v24 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20245 while ( v23 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20247 v27 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20248 for ( j = 0; j < v45; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20250 v29 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20251 if ( pActors[v29].uAttributes & 0xC000 && pActors[v29].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20253 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20254 if ( v27 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20256 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20257 v31 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20258 v32 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20259 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20260 ai_array_4F6638_actor_ids[v31] = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20262 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20264 while ( ai_array_4F6638_actor_ids[v30] != ai_array_4F7DB0_actor_ids[j] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20266 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20267 if ( v30 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20268 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20273 v33 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20274 if ( ai_arrays_size > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20276 v33 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20277 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20279 memcpy(ai_array_4F7DB0_actor_ids, ai_array_4F6638_actor_ids, 4 * v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20280 memcpy(ai_array_4F75E0, ai_array_4F5E68, 4 * ai_arrays_size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20281 v34 = (unsigned int)ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20282 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20284 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20286 v35 = (char *)&pActors[ai_array_4F7DB0_actor_ids[HIDWORD(v34)]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20287 v35[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20288 ++HIDWORD(v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20290 while ( SHIDWORD(v34) < (signed int)v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20292 return v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20294 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20295
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20296 //----- (00401A91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20297 void __cdecl sub_401A91_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20299 unsigned int v0; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20300 int v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20301 int v2; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20302 int v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20303 signed int v4; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20304 char *v5; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20305 signed int v6; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20306 __int16 v7; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20307 Player **v8; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20308 Player *pPlayer; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20309 Actor *pActor; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20310 __int16 v11; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20311 unsigned int v12; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20312 signed int v13; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20313 SpellBuff *v14; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20314 unsigned int v15; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20315 char *v16; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20316 unsigned int v17; // edx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20317 unsigned int v18; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20318 unsigned __int16 v19; // ax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20319 int *v20; // esi@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20320 Actor *v21; // ebx@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20321 unsigned __int16 v22; // ax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20322 signed int v23; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20323 unsigned int v24; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20324 signed int v25; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20325 SpellBuff *v26; // esi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20326 unsigned int v27; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20327 unsigned int v28; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20328 unsigned int v29; // eax@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20329 AIDirection *v30; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20330 unsigned __int16 v31; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20331 unsigned int v32; // esi@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20332 int v33; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20333 int v34; // eax@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20334 char v35; // al@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20335 unsigned int v36; // edi@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20336 signed int v37; // eax@154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20337 unsigned __int8 v38; // sf@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20338 unsigned __int8 v39; // of@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20339 signed int v40; // edx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20340 unsigned int v41; // ecx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20341 double v42; // st7@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20342 double v43; // st6@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20343 bool v44; // eax@189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20344 bool v45; // eax@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20345 unsigned __int8 v46; // cl@197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20346 double v47; // st7@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20347 double v48; // st7@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20348 char v49; // zf@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20349 char v50; // zf@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20350 signed int v51; // edx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20351 unsigned int v52; // ecx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20352 __int16 v53; // fps@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20353 unsigned __int8 v54; // c0@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20354 unsigned __int8 v55; // c3@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20355 double v56; // st7@226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20356 AIDirection *v57; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20357 double v58; // st7@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20358 signed int v59; // [sp-18h] [bp-C8h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20359 int v60; // [sp-14h] [bp-C4h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20360 int v61; // [sp-14h] [bp-C4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20361 AIDirection *v62; // [sp-14h] [bp-C4h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20362 signed int v63; // [sp-14h] [bp-C4h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20363 unsigned int v64; // [sp-14h] [bp-C4h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20364 unsigned int v65; // [sp-10h] [bp-C0h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20365 char v66; // [sp-10h] [bp-C0h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20366 AIDirection *v67; // [sp-10h] [bp-C0h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20367 int v68; // [sp-10h] [bp-C0h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20368 AIDirection *v69; // [sp-10h] [bp-C0h]@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20369 int v70; // [sp-10h] [bp-C0h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20370 AIDirection *v71; // [sp-10h] [bp-C0h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20371 AIDirection v72; // [sp+0h] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20372 AIDirection a3; // [sp+1Ch] [bp-94h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20373 AIDirection v74; // [sp+38h] [bp-78h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20374 AIDirection v75; // [sp+54h] [bp-5Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20375 int v76; // [sp+70h] [bp-40h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20376 signed int a1; // [sp+74h] [bp-3Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20377 int v78; // [sp+78h] [bp-38h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20378 AIDirection pDir; // [sp+7Ch] [bp-34h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20379 float v80; // [sp+98h] [bp-18h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20380 int v81; // [sp+9Ch] [bp-14h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20381 int v82; // [sp+A0h] [bp-10h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20382 unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20383 unsigned int v84; // [sp+A8h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20384 signed int a2; // [sp+ACh] [bp-4h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20386 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20387 ODM_4014E6_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20388 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20389 BLV_4016FA_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20390 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20391 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor && pParty->field_1613C > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20393 if ( pParty->field_1613C > 417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20395 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20397 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20399 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (pParty->sRotationY + rand() % 16 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20400 v1 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20401 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20402 v3 = pParty->sRotationX + v1 % 16 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20403 pParty->sRotationX = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20404 if ( v3 > 128 || (v2 = -128, v3 < -128) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20405 pParty->sRotationX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20406 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20407 pParty->field_1613C -= pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20408 v4 = pParty->field_16140 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20409 if ( pParty->field_1613C <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20411 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20412 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20413 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20415 v5 = (char *)&pActors[0].sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20416 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20418 if ( ((Actor *)(v5 - 40))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20420 v6 = stru_50C198.CalcMagicalDamageToActor((Actor *)(v5 - 40), 5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20421 v7 = *(short *)v5 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20422 *(short *)v5 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20423 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20425 if ( v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20427 Actor::_4030AD(v84, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20429 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20431 Actor::Die(v84);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20432 if ( *((int *)v5 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20433 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[*((short *)v5 + 28)].uExp);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20437 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20438 v5 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20440 while ( (signed int)v84 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20442 v8 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20443 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20445 pPlayer = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20446 if ( !(*v8)->pConditions[14] && !pPlayer->pConditions[15] && !pPlayer->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20447 pPlayer->ReceiveDamage(v4, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20448 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20450 while ( (signed int)v8 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20451 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20453 if ( pTurnEngine->field_1C != v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20454 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20457 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20459 pTurnEngine->_405E14();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20460 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20462 uActorID = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20463 if ( (signed int)uNumActors > (signed int)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20465 LODWORD(v80) = (int)(char *)pActors + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20466 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20468 pActor = (Actor *)(LODWORD(v80) - 176);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20469 v11 = *(unsigned int *)LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20470 v49 = *(unsigned int *)LODWORD(v80) == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20471 dword_4F6E08[uActorID] = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20472 if ( v49 || v11 == 11 || v11 == 19 || *(char *)(LODWORD(v80) - 139) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20473 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20474 if ( !*(short *)(LODWORD(v80) - 136) && v11 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20475 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20476 v84 = *(_QWORD *)(LODWORD(v80) + 84) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20477 v82 = *(_QWORD *)(LODWORD(v80) + 52) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20478 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20479 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20480 v14 = (SpellBuff *)(LODWORD(v80) + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20481 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20483 if ( v13 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20485 v14->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20486 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20488 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20489 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20491 while ( v13 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20492 if ( v84 != v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20493 && SHIDWORD(pActor->pActorBuffs[3].uExpireTime) <= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20494 && (SHIDWORD(pActor->pActorBuffs[3].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20495 || LODWORD(pActor->pActorBuffs[3].uExpireTime) <= v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20496 pActor->uActorHeight = pMonsterList->pMonsters[pActor->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20497 if ( v82 != v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20498 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20499 pActor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20500 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) <= (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20502 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20503 || LODWORD(pActor->pActorBuffs[1].uExpireTime) <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20504 pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20507 if ( SHIDWORD(pActor->pActorBuffs[5].uExpireTime) > (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20508 || SHIDWORD(pActor->pActorBuffs[5].uExpireTime) >= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20509 && LODWORD(pActor->pActorBuffs[5].uExpireTime)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20510 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) > 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20511 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(pActor->pActorBuffs[6].uExpireTime) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20512 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20513 v15 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20514 v16 = (char *)&pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20515 pActor->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20516 v17 = pActor->uCurrentActionTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20517 v18 = pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20518 if ( (signed int)v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20519 *(int *)v16 = v18 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20520 if ( *(int *)v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20521 *(int *)v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20522 if ( (signed int)v17 < pActor->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20523 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20524 v19 = pActor->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20525 if ( v19 == Dying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20527 pActor->uAIState = Dead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20529 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20531 if ( v19 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20533 Actor::_403F58(uActorID, Dying, 256, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20534 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20535 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
20536 pActor->uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20538 pActor->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20539 pActor->uCurrentActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20540 pActor->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20541 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20542 ++uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20543 LODWORD(v80) += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20545 while ( (signed int)uActorID < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20547 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20548 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20550 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20552 uActorID = ai_array_4F7DB0_actor_ids[v78];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20553 v20 = &dword_4F6E08[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20554 v21 = &pActors[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20555 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20556 if ( v21->pMonsterInfo.uHostilityType && !*v20 )
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20557 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20558 a2 = *v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20559 v76 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20560 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20561 v80 = 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20562 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20563 v80 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20564 v22 = v21->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20565 if ( v22 == 4 || v22 == 5 || v22 == 11 || v22 == 19 || v22 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20566 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20567 if ( !v21->sCurrentHP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20568 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20569 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20571 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20572 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20574 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20576 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20577 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20579 if ( (signed __int64)v21->pActorBuffs[1].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20580 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20581 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20582 v82 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20583 if ( (signed __int64)v21->pActorBuffs[2].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20584 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20585 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20586 v81 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20587 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20588 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20589 v26 = v21->pActorBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20590 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20592 if ( v25 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20594 v26->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20595 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20597 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20598 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20600 while ( v25 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20601 if ( v84 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20602 && SHIDWORD(v21->pActorBuffs[3].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20603 && (SHIDWORD(v21->pActorBuffs[3].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20604 || LODWORD(v21->pActorBuffs[3].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20605 v21->uActorHeight = pMonsterList->pMonsters[v21->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20606 if ( v82 != v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20607 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20608 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20609 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) <= (signed int)v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20611 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20612 || LODWORD(v21->pActorBuffs[1].uExpireTime) <= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20613 v21->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[v21->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20616 if ( v81 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20617 && SHIDWORD(v21->pActorBuffs[2].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20618 && (SHIDWORD(v21->pActorBuffs[2].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20619 || LODWORD(v21->pActorBuffs[2].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20620 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
20621 v21->uAIState = Removed;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20622 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20624 if ( v21->pActorBuffs[5].uExpireTime || v21->pActorBuffs[6].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20625 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20626 v27 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20627 v28 = v21->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20628 v21->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20629 if ( (signed int)v28 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20630 v21->pMonsterInfo.uRecoveryTime = v28 - v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20631 if ( (v21->pMonsterInfo.uRecoveryTime & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20632 v21->pMonsterInfo.uRecoveryTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20633 v29 = v21->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20634 if ( !(v29 & 0x8000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20635 v21->uAttributes = v29 | 0x8000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20636 a1 = 8 * uActorID | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20637 v30 = Actor::GetDirectionInfo(8 * uActorID | 3, a2, &a3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20638 v49 = v21->pMonsterInfo.uHostilityType == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20639 memcpy(&v75, v30, sizeof(v75));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20640 memcpy(&pDir, &v75, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20641 if ( !v49 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20643 if ( v80 * 307.2 >= (double)(signed int)v75.uDistance
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20644 && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20645 || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20647 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20648 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20651 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20652 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20653 if ( v21->uAIState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20655 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20656 v35 = stru_50C198.special_ability_use_check(v21, uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20657 stru_50FE08.Add(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20658 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20659 5120,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20660 v21->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20661 v21->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20662 v21->vPosition.z + ((signed int)v21->uActorHeight >> 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20663 v35,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20664 1);
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 if ( v21->uAIState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20669 v34 = v21->pMonsterInfo.uMissleAttack1Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20670 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20671 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20673 if ( v21->uAIState == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20675 v34 = v21->pMonsterInfo.uMissleAttack2Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20676 v66 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20677 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20678 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20679 Actor::_404874(uActorID, &pDir, v34, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20680 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20682 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20683 if ( v21->uAIState == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20684 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20685 if ( v21->uAIState == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20687 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20688 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20689 v33 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20690 LABEL_146:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20691 Actor::_404AC7(uActorID, &pDir, v33, v60, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20693 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20694 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20695 if ( v21->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20696 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20697 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20699 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20700 v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (v21->pMonsterInfo.uID - 1) / 3]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20701 + (pActors[a2 >> 3].pMonsterInfo.uID - 1) / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20703 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20705 v37 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20707 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20708 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20709 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20711 v39 = __OFSUB__(v36, 1024);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20712 v38 = ((v36 - 1024) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20716 if ( v37 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20718 v39 = __OFSUB__(v36, 2560);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20719 v38 = ((v36 - 2560) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20723 if ( v37 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20724 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20725 v39 = __OFSUB__(v36, 5120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20726 v38 = ((v36 - 5120) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20729 if ( v38 ^ v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20730 LABEL_257:
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20731 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20732 LABEL_165:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20733 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20735 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20736 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20737 if ( (signed int)v36 >= 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20739 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20740 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20741 goto LABEL_253;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20743 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20744 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20746 if ( v21->pMonsterInfo.uHostilityType != 4 || !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20747 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20748 if ( !(v21->uAttributes & 0x020000) || v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20750 if ( v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20752 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20753 if ( v21->pMonsterInfo.uMovementType != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20754 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20755 Actor::_403EB6(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20756 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20757 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20758 (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20759 &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20761 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20763 if ( v21->pMonsterInfo.uAIType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20765 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20766 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20767 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20769 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20771 if ( v21->pMonsterInfo.uAIType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20772 goto LABEL_185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20773 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20774 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20775 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20777 if ( v43 > v42 && (signed int)v36 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20779 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20780 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20781 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20782 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20783 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20784 Actor::_402968(v41, v40, 0, v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20785 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20789 LABEL_185:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20790 v81 = v36 - v21->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20791 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20792 v81 -= pActors[a2 >> 3].uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20793 if ( v81 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20794 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20795 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20796 v44 = (signed int)v21->pMonsterInfo.uRecoveryTime <= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20797 v21->uAttributes &= 0xFBFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20798 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20799 v49 = v21->pMonsterInfo.uMovementType == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20800 v84 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20801 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20802 v82 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20803 if ( v81 >= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20804 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20805 v45 = stru_50C198.special_ability_use_check(v21, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20806 if ( !v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20808 if ( v21->pMonsterInfo.uMissleAttack1Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20810 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20812 Actor::_403476(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20813 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20815 LABEL_223:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20816 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20817 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20818 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20819 //UNDEF(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20820 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20821 if ( !(v54 | v55) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20822 goto LABEL_219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20823 LABEL_225:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20824 Actor::_402AD7(v32, a2, v32, (signed __int64)v47, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20825 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20827 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20828 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20830 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20832 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20833 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20834 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20835 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20836 goto LABEL_240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20838 goto LABEL_235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20840 goto LABEL_227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20842 if ( v45 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20844 if ( v45 > 1 && v45 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20846 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20847 v46 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20848 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20849 v46 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20850 if ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20852 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20854 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20855 Actor::_403854(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20856 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20857 Actor::_403A60(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20858 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20860 if ( v80 * 307.2 > (double)v81 || v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20862 LABEL_217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20863 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20864 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20865 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20866 LABEL_219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20867 v51 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20868 v64 = (signed __int64)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20869 v52 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20870 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20871 Actor::_403EB6(v52, v51, v64, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20872 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20874 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20875 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20876 goto LABEL_225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20878 v48 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20879 if ( (double)v81 >= v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20881 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20883 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20884 LABEL_215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20885 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20886 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20887 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20888 v63 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20889 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20890 Actor::_402686(v32, a2, v63, v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20891 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20893 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20894 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20895 v70 = (signed __int64)v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20896 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20897 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20898 goto LABEL_237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20900 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20901 goto LABEL_209;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20903 LABEL_241:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20904 if ( !v21->pMonsterInfo.uMovementType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20906 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20907 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20908 LABEL_252:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20909 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20910 v40 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20911 LABEL_253:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20912 Actor::_4032B2(v41, v40, v61, v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20913 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20915 if ( v21->pMonsterInfo.uMovementType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20917 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20918 v61 = 2560;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20919 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20921 if ( v21->pMonsterInfo.uMovementType == 2 )
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 = 5120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20925 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20927 if ( v21->pMonsterInfo.uMovementType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20929 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20930 v61 = 10240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20931 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20933 if ( v21->pMonsterInfo.uMovementType == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20935 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20936 v58 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20937 memcpy(&v74, v57, sizeof(v74));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20938 memcpy(&pDir, &v74, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20939 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20940 v52 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20941 v64 = (signed __int64)v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20942 v51 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20943 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20945 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20947 if ( !v21->pMonsterInfo.uMissleAttack2Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20949 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20950 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20952 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20954 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20955 goto LABEL_215;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20957 LABEL_235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20958 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20959 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20960 v70 = (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20961 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20962 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20963 LABEL_237:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20964 Actor::_40281C(v32, a2, v59, v62, v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20965 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20967 LABEL_227:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20968 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20969 LABEL_209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20970 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20971 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20972 goto LABEL_218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20973 Actor::_403C6C(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20974 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20976 if ( !v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20977 goto LABEL_223;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20978 Actor::_40368B(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20979 LABEL_254:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20980 ++v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20981 if ( v78 >= ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20982 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20984 v65 = v21->pMonsterInfo.uSpellSkillAndMastery1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20985 v60 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20986 v33 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20987 goto LABEL_146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20990
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20991
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20992
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20994 //----- (0040261D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20995 int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20997 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20998
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20999 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21000 if ( this->count < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21002 this->pIDs[result] = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21003 this->pXs[this->count] = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21004 this->pYs[this->count] = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21005 this->pZs[this->count] = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21006 this->field_324[this->count] = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21007 this->field_3EC[this->count] = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21008 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21009 this->field_450[this->count++] = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21011 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21013
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21014
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21015
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21016
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21018 //----- (00402CAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21019 int stru193_math::SinCos(int angle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21020 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21021 int v2; // eax@1
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21022
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21023 //a2: (angle - uIntegerHalfPi) for sin(angle)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21024 // (angle) for cos(angle)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21025
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21026 v2 = uDoublePiMask & angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21027
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21028 if ( v2 > uIntegerPi )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21029 v2 = uIntegerDoublePi - v2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21030 if ( v2 >= uIntegerHalfPi )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21031 return -pCosTable[uIntegerPi - v2];
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21032 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21033 return pCosTable[v2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21040
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21041
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21042
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21049 //----- (00404544) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21050 signed int stru262_TurnBased::_404544()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21052 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21053 TurnBased_QueueElem *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21054 Actor *v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21055 Actor *v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21056 Player *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21057 int v6; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21058 TurnBased_QueueElem *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21059 TurnBased_QueueElem *v8; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21060 int v9; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21061 int v10; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21062 int v11; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21063 int v12; // ST0C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21064 int v13; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21065 int v14; // ST14_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21066 int v15; // ST18_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21067 signed int result; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21068 TurnBased_QueueElem *v17; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21069 int v18; // [sp+20h] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21070 int v19; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21071 int v20; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21072 signed int v21; // [sp+28h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21073 int v22; // [sp+28h] [bp-4h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21075 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21076 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21077 v19 = this->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21078 if ( this->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21080 v2 = this->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21081 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21083 if ( (v2->uPackedID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21085 v3 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21086 v4 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21087 LOBYTE(v4->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21088 if ( !v4->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21090 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21091 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21092 LOBYTE(v3->uAttributes) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21095 if ( (v2->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21097 v5 = &pParty->pPlayers[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21098 if ( v5->pConditions[14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21099 || v5->pConditions[16]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21100 || v5->pConditions[15]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21101 || v5->pConditions[13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21102 || v5->pConditions[12]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21103 || v5->pConditions[2] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21105 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21106 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21109 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21110 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21112 while ( v20 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21114 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21115 if ( v6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21117 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21118 v7 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21119 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21121 v18 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21122 if ( v21 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21124 v8 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21125 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21127 v9 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21128 v10 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21129 if ( v9 < v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21130 || v9 == v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21131 && ((v11 = v8->uPackedID & 7, v11 == 4) && (v7->uPackedID & 7) == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21132 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21134 v12 = v7->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21135 v13 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21136 v14 = v7->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21137 v15 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21138 v7->uPackedID = v8->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21139 v7->field_4 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21140 v7->uActionLength = v8->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21141 v7->field_C = v8->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21142 v8->uPackedID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21143 v8->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21144 v8->uActionLength = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21145 v8->field_C = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21147 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21148 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21150 while ( v18 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21152 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21153 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21154 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21156 while ( v21 - 1 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21158 v1->uActorQueueSize = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21159 result = v1->pQueue[0].uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21160 if ( (v1->pQueue[0].uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21162 result = (result >> 3) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21163 uActiveCharacter = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21164 v1->field_18 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21166 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21168 uActiveCharacter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21169 v1->field_18 &= 0xFFFFFFFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21171 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21172 if ( v1->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21174 v17 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21175 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21177 if ( (v17->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21178 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21179 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21180 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21181 result = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21183 while ( v22 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21185 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21188 //----- (0040471C) --------------------------------------------------------
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21189 void stru262_TurnBased::_40471C()
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21190 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21191 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21193 if ( pTurnEngine->field_4 == 2 )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21194 _406457(0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21195 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21198
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21199 //----- (00404828) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21200 LayingItem::LayingItem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21202 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21204 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21205 v1->field_22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21206 v1->uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21207 v1->uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21208 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21209 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21210 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21211 v1->uItemType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21212 v1->uObjectDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21213 v1->field_61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21214 v1->field_60_distance_related_prolly_lod = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21215 v1->field_20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21216 v1->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21217 v1->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21218 v1->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21219 v1->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21220 v1->field_54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21222
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21225 //----- (004059DB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21226 signed int stru262_TurnBased::Start()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21228 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21229 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21230 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21231 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21232 unsigned int v5; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21233 Actor *v6; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21234 unsigned int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21235 unsigned int v8; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21236 unsigned __int8 v9; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21237 unsigned __int8 v10; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21238 unsigned __int8 v11; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21239 char *v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21240 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21241 unsigned __int16 v14; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21242 int v15; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21243 signed __int64 v16; // qax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21244 int v17; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21245 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21246 char *v19; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21247 int v20; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21248 char *v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21249 int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21250 int v23; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21251 char *v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21252 char *v25; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21253 int v26; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21254 int v27; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21255 int v28; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21256 AIDirection v30; // [sp+Ch] [bp-68h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21257 AIDirection v31; // [sp+28h] [bp-4Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21258 AIDirection a3; // [sp+44h] [bp-30h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21259 int v33; // [sp+60h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21260 int *v34; // [sp+64h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21261 int v35; // [sp+68h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21262 int v40; // [sp+6Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21263 unsigned int v37; // [sp+70h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21264
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21265 pTurnEngine->field_18 &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21266 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21267 pEventTimer->TrackGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21268 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21269 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21270 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21271 v40 = (int)pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21272 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21273 dword_50C994 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21274 v1->field_10 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21275 v1->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21276 v1->field_8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21277 v1->field_4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21278 v1->uActorQueueSize = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21279 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21280 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21282 if ( ((Player *)v40)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21284 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21285 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21286 v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21287 pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21289 v40 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21290 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21292 while ( v40 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21293 v35 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21294 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21295 v40 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21296 if ( v40 < v40 + ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21298 v34 = (int *)ai_array_4F7DB0_actor_ids;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21299 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21301 v37 = *v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21302 v5 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21303 v6 = &pActors[v37];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21304 if ( v37 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21306 if ( pActors[v37].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21308 v7 = v6->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21309 if ( v7 & 0x8000 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21311 v8 = dword_4F6E08[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21312 LOBYTE(v7) = v7 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21313 v6->uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21314 v33 = 8 * v5 | OBJECT_Actor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21315 memcpy(&v31, Actor::GetDirectionInfo(8 * v5 | OBJECT_Actor, v8, &a3, 0), sizeof(v31));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21316 memcpy(&v30, &v31, sizeof(v30));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21317 Actor::_403F58(v37, 4, 32, &v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21318 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21319 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21320 v1->pQueue[v1->uActorQueueSize++].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21323 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21325 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21326 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21328 while ( v40 < v4 + ai_arrays_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21329 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21331 v11 = __OFSUB__(v1->uActorQueueSize, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21332 v9 = v1->uActorQueueSize == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21333 v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21334 v37 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21335 v40 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21336 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21338 v12 = (char *)&v1->pQueue[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21339 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21341 v13 = *((int *)v12 - 1) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21342 if ( v13 != OBJECT_Player )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21343 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21344 v14 = pPlayers[(*((int *)v12 - 1) >> 3) + 1]->uTimeToRecovery;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21345 if ( v14 != (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21347 v33 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21348 v16 = (signed __int64)((double)v14 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21349 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21350 *(int *)v12 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21351 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21353 v15 = v37++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21354 *(&a3.uDistance + v15) = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21355 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21356 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21357 v12 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21358 if ( v40 >= v1->uActorQueueSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21359 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21361 if ( v13 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21363 *(int *)v12 = 666;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21364 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21366 v17 = rand() % 99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21367 if ( v17 < 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21369 *(int *)v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21370 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21372 LODWORD(v16) = SHIDWORD(v16) < 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21373 LOBYTE(v16) = SHIDWORD(v16) >= 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21374 LODWORD(v16) = 2 * v16 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21375 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21377 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21378 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21379 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21381 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21383 *(&v31.uDistance + v18) = pParty->pPlayers[*(&v1->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21384 v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21385 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21387 while ( (signed int)v18 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21388 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21390 v35 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21391 v34 = (int *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21392 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21394 v40 = (int)v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21395 if ( (signed int)v34 < (signed int)v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21397 v19 = (char *)&v31.uDistance + v35;
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 v20 = *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21401 v33 = 4 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21402 v21 = (char *)(&v31.uDistance + v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21403 v22 = *(int *)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21404 if ( *(int *)v21 < v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21406 *(int *)v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21407 v23 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21408 *(int *)v19 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21409 v24 = (char *)&a3.uDistance + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21410 v25 = (char *)&a3.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21411 v26 = *(int *)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21412 *(int *)v24 = *(unsigned int *)((char *)&a3.uDistance + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21413 *(int *)v25 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21414 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21416 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21418 while ( v40 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21420 v34 = (int *)((char *)v34 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21421 v35 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21423 while ( (signed int)((char *)v34 - 1) < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21424 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21426 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21428 v27 = v2 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21429 v28 = *(&a3.uDistance + v2++);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21430 v11 = __OFSUB__(v2, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21431 v10 = ((v2 - v37) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21432 v1->pQueue[v28].field_4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21434 while ( v10 ^ v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21438 return v1->_404544();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21440