annotate mm7_3.cpp @ 58:41cbaabde2cb

BLV render
author Nomad
date Thu, 25 Oct 2012 02:05:16 +0200
parents fd2fd234a66c
children 5159d2e6f559
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;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 v7 = v4->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 f.uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 f.pBounding.x1 = v4->pBoundingBox.x1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 f.pBounding.y1 = v4->pBoundingBox.y1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 f.pBounding.z1 = v4->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 f.pBounding.x2 = v4->pBoundingBox.x2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 f.pBounding.y2 = v4->pBoundingBox.y2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 f.pBounding.z2 = v4->pBoundingBox.z2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 f.zCalc1 = v4->zCalc1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 f.zCalc2 = v4->zCalc2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 f.zCalc3 = v4->zCalc3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 f.pXInterceptDisplacements = v4->pXInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 f.pYInterceptDisplacements = v4->pYInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 f.pZInterceptDisplacements = v4->pZInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 f.uPolygonType = (PolygonType)v4->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 f.uNumVertices = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 f.uBitmapID = v4->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 f.pVertexIDs = v4->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 if ( !(v7 & 0x20000000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 if ( !(v7 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 v2 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 v27 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 if ( v3 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 v8 = (v5 * stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 + v6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 + f.pFacePlane_old.vNormal.y * stru_721530.normal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 + f.pFacePlane_old.vNormal.x * stru_721530.normal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 v9 = (v5 * stru_721530.normal2.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 + v6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 + f.pFacePlane_old.vNormal.y * stru_721530.normal2.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 + f.pFacePlane_old.vNormal.x * stru_721530.normal2.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 if ( v8 <= stru_721530.prolly_normal_d || v9 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 if ( v9 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 a2 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 if ( sub_4754BF(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 stru_721530.prolly_normal_d,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 stru_721530.normal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 a11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 v10 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 v11 = stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 v12 = stru_721530.field_58.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 v13 = stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 a2 = stru_721530.prolly_normal_d + stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 if ( !sub_475F30(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 v13,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 v10 = a2 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 a2 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 if ( v10 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 stru_721530.field_7C = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 v14 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 LOBYTE(v14) = v14 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 stru_721530.uFaceID = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 if ( stru_721530.field_0 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 v15 = (f.pFacePlane_old.vNormal.z * stru_721530.field_34.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 + f.pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 + f.pFacePlane_old.vNormal.y * stru_721530.field_34.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 + f.pFacePlane_old.vNormal.x * stru_721530.field_34.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 v16 = (f.pFacePlane_old.vNormal.z * stru_721530.field_54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 + f.pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 + f.pFacePlane_old.vNormal.y * stru_721530.field_50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 + f.pFacePlane_old.vNormal.x * stru_721530.field_4C) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 if ( v15 <= stru_721530.prolly_normal_d || v16 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 if ( v16 <= v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 a2 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 if ( sub_4754BF(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 stru_721530.field_8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 stru_721530.field_34.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 a11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 if ( a2 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 stru_721530.field_7C = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 v17 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 LOBYTE(v17) = v17 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 stru_721530.uFaceID = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 v18 = stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 v19 = stru_721530.field_58.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 v20 = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 a2 = stru_721530.field_6C + stru_721530.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 if ( sub_475F30(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 v20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 v18,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 v2 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 v21 = a2 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 a2 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 if ( a2 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 stru_721530.field_7C = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 v22 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 stru_721530.uFaceID = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 //----- (0046ED1B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 int __fastcall _46ED1B_collide_against_floor(signed int a1, signed int a2, int a3, unsigned int *pSectorID, int *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 unsigned int *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 int v8; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 int v9; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 v5 = pSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 v8 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 result = _46CEC3_get_floor_level(a1, a2, a3, *pSectorID, (int *)&pSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 if ( result != -30000 && result <= a3 + 50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 || (v7 = pIndoor->GetSector(v8, v9, a3), (*v5 = v7) != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 && (result = _46CEC3_get_floor_level(v8, v9, a3, v7, (int *)&pSectorID), result != -30000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 *a5 = (int)pSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 result = -30000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 //----- (0046ED8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 void __fastcall _46ED8A_collide_against_layingItems(unsigned int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 int v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 ObjectDesc *v2; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 int v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 int v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 int v6; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 int v8; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 int v9; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 int v10; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 int v11; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 signed int v12; // [sp+0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 int v13; // [sp+4h] [bp-10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 char *v14; // [sp+8h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 unsigned int v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 v12 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 v1 = (int)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 v14 = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 if ( *(short *)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 v2 = &pObjectList->pObjects[*(short *)v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 if ( !(v2->uFlags & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 v3 = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 v4 = *(int *)(v1 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 if ( stru_721530.sMaxX <= v4 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 if ( stru_721530.sMinX >= v4 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 v5 = *(int *)(v1 + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 if ( stru_721530.sMaxY <= v5 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 if ( stru_721530.sMinY >= v5 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 v6 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 v7 = *(int *)(v1 + 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 v13 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 if ( stru_721530.sMaxZ <= v7 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 if ( stru_721530.sMinZ >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 v8 = v4 - stru_721530.normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 v9 = v5 - stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 if ( abs(((v4 - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 - (v5 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16) <= v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 + stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 v10 = (v8 * stru_721530.field_58.x + v9 * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 if ( v10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 v11 = stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 if ( v11 >= *(int *)(v14 + 10) - stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 if ( v11 <= v13 + stru_721530.prolly_normal_d + *(int *)(v14 + 10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 if ( v10 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 sub_46DEF2(v12, v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 v1 = (int)(v14 + 112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 v14 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 while ( (signed int)v15 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 //----- (0046EF01) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 int __thiscall _46EF01_collision_chech_player(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 int v3; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 int v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 int v8; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 unsigned int v9; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 int v10; // [sp+14h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 int v11; // [sp+18h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 v8 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 v1 = 2 * pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 result = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 v9 = pParty->uPartyHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 if ( stru_721530.sMaxX <= pParty->vPosition.x + 2 * pParty->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 if ( stru_721530.sMinX >= pParty->vPosition.x - v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 {
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];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 if ( !(BYTE3(v41->uFaceAttributes) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 v42 = v41->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 if ( v42 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 v43 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 v44 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 v0->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 v0->vPosition.z = LOWORD(v40->pVertices.pVertices[v41->pVertexIDs[0]].z) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 if ( v44 * v44 + v43 * v43 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 v0->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 v0->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 v72 = abs(v41->pFacePlane.vNormal.y * v0->vVelocity.y + v41->pFacePlane.vNormal.z * v0->vVelocity.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 + v41->pFacePlane.vNormal.x * v0->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 if ( stru_721530.field_64 >> 3 > v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 v72 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 v73 = v41->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 v73 = (unsigned __int64)(v72 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 v71 = v41->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 v71 = (unsigned __int64)(v72 * (signed __int64)v71) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 v70 = v41->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 v70 = (unsigned __int64)(v72 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 v0->vVelocity.x += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 v0->vVelocity.y += v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 v0->vVelocity.z += v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 if ( v42 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 v45 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 v46 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 - ((v41->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 + v41->pFacePlane.vNormal.x * v0->vPosition.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 + v41->pFacePlane.vNormal.y * v0->vPosition.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 + v41->pFacePlane.vNormal.z * v0->vPosition.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 if ( v46 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 v0->vPosition.x += (unsigned int)(v46 * v41->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 v0->vPosition.y += (unsigned int)(v46 * v41->pFacePlane.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v0->vPosition.z = v45 + ((unsigned int)(v46 * v41->pFacePlane.vNormal.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 v0->uYawAngle = stru_5C6E00->Atan2(v0->vVelocity.x, v0->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 v70 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 v71 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 v70 = (unsigned __int64)(58500i64 * (signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 v0->vVelocity.x = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 v70 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 v70 = (unsigned __int64)(v71 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 v71 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 v0->vVelocity.y = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 v70 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 v70 = (unsigned __int64)(v71 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 v54 = __OFSUB__(v69, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 v10 = ((v69 - 100) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 v0->vVelocity.z = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 if ( !(v10 ^ v54) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 v26 = stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 v69 = WorldPosToGridCellX(v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 v55 = WorldPosToGridCellZ(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 v56 = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 v57 = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 v71 = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 v68 = WorldPosToGridCellX(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 v70 = WorldPosToGridCellZ(v0->vPosition.y) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 v58 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v69, v56) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 v59 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v68, v70) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 if ( v69 == v68 && v71 == v70 && v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 if ( !v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 if ( !v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 if ( MonsterStats::BelongsToSupertype(v0->pMonsterInfo.uID, MONSTER_SUPERTYPE_WATER_ELEMENTAL) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 v58 = v58 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 v59 = v59 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 if ( !v74 && v58 && !v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 v0->vPosition.x = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 v0->vPosition.y = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 if ( v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 v0->uYawAngle -= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 v0->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 v0->uCurrentActionLength = 128;
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 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 //----- (0047136C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 void LayingItem::UpdateObject_fn0_BLV(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 ObjectDesc *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 int v3; // ST08_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 __int16 v4; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 BLVFace *v6; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 BLVFace *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 signed int v8; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 int v9; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 __int16 v10; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 char v11; // al@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 int v12; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 int v13; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 int v14; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 signed int v15; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 BLVFace *v16; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 int v17; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 int v18; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 int v19; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 Vec3_short_ *v20; // ecx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 int v21; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 __int16 v22; // ax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 int v23; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 int v24; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 int v25; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 unsigned __int64 v26; // qax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 unsigned __int8 v27; // sf@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 unsigned __int8 v28; // of@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 __int16 v29; // di@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 char v30; // al@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 const char *v31; // [sp-8h] [bp-98h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 const char *v32; // [sp-8h] [bp-98h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 Particle_ Dst; // [sp+Ch] [bp-84h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 ObjectDesc *v37; // [sp+78h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 int v38; // [sp+7Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 int v39; // [sp+80h] [bp-10h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 int v40; // [sp+84h] [bp-Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 int v41; // [sp+88h] [bp-8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 int v42; // [sp+8Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 v3 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 v37 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 if ( abs(v3) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 || abs(v1->vPosition.y) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 || abs(v1->vPosition.z) > 20000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v1->uSectorID, &v38),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 v42 <= -30000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 && ((v4 = pIndoor->GetSector(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 (v1->uSectorID = v4) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v4, &v38), v42 == -30000)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 v5 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 if ( v5 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 stru_721530.field_0 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 v12 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 stru_721530.field_C = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 stru_721530.field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 stru_721530.field_70 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 stru_721530.field_34.y = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 stru_721530.normal.y = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 stru_721530.field_34.z = stru_721530.prolly_normal_d + v1->vPosition.z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 stru_721530.uSectorID = v1->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 if ( stru_721530._47050A(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 v40 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 _46E44E_collide_against_faces_and_portals(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 _46EF01_collision_chech_player(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 v13 = v1->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 v42 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 if ( (v13 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 v41 = pActors[v1->field_58 >> 3].pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 v14 = (signed __int64)((double)v41 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 v41 = *(short *)(v39 - 38) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 _46DF1A_collide_against_actor(v42, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 ++v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 _46DF1A_collide_against_actor(v42++, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 while ( v40 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 v29 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 if ( v29 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 v32 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 if ( v29 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 v32 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1562 Dst.timeToLive = (unsigned __int8)(v30 & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 v15 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 v23 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v1->vPosition.x - pLevelDecorations[v15].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v1->vPosition.y - pLevelDecorations[v15].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 v42 = stru_5C6E00->SinCos(v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 v24 = v23 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 v1->vVelocity.x = (unsigned int)(v42 * v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 v25 = stru_5C6E00->SinCos(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 v42 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 v26 = v25 * (signed __int64)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 v41 = v26 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 v1->vVelocity.y = WORD1(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 if ( (stru_721530.uFaceID & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 v16 = &pIndoor->pFaces[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 if ( v16->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 v42 = abs(v16->pFacePlane_old.vNormal.x * v1->vVelocity.x + v16->pFacePlane_old.vNormal.z * v1->vVelocity.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 + v16->pFacePlane_old.vNormal.y * v1->vVelocity.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 if ( stru_721530.field_64 >> 3 > v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 v42 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 v40 = v16->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 v40 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 v41 = v16->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 v41 = (unsigned __int64)(v42 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 v39 = v16->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 v39 = (unsigned __int64)(v42 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 v1->vVelocity.x += 2 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 v1->vVelocity.y += 2 * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 if ( v16->pFacePlane_old.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 v22 = 2 * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 v21 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 v40 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 v1->vVelocity.z += v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 v41 = (unsigned __int64)(v40 * (signed __int64)v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 v22 = (unsigned int)(v40 * v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 v1->vVelocity.z += v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 if ( v37->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 v17 = -v1->vVelocity.z >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 v1->vVelocity.z = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 if ( (signed __int16)v17 < 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 if ( BYTE3(v16->uAttributes) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 v18 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 v19 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 if ( v19 * v19 + v18 * v18 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 v20 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 v1->vPosition.z = v20[*v16->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 v2 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 v41 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 v41 = (unsigned __int64)(58500i64 * v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 v1->vVelocity.x = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 v41 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 v1->vVelocity.y = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 v41 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 v28 = __OFSUB__(v38, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 v27 = v38 - 100 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 v1->vVelocity.z = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 if ( !(v27 ^ v28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 if ( v42 <= v1->vPosition.z - 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 v6 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 v1->vPosition.z = v42 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 v7 = &v6[v38];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 if ( v7->uPolygonType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 if ( v7->pFacePlane_old.vNormal.z < 45000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 v42 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 v38 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 v42 = (unsigned __int64)(58500i64 * v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 v1->vVelocity.x = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 v42 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 v38 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 v1->vVelocity.y = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 v42 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 v9 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 v1->vVelocity.z = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 if ( v9 * v9 + v1->vVelocity.y * v1->vVelocity.y < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 v1->vVelocity.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 v1->vVelocity.y = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 v1->vVelocity.x = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 if ( v10 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 v31 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 if ( v10 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 Dst.uDiffuse = rand();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1736 Dst.timeToLive = 64;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 Dst.uTextureID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 v31 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1749 Dst.timeToLive = (unsigned __int8)(v11 & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 //----- (00471C03) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 void LayingItem::UpdateObject_fn0_ODM(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 ObjectDesc *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 int v5; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 __int16 v10; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 int v12; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 signed int v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 int v16; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 int v17; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 signed int v18; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 signed int v19; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 Actor *v20; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 int v21; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 int v22; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 __int16 v23; // bx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 char v24; // al@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 signed int i; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 int v26; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 int v27; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 __int16 v28; // cx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 signed int v30; // edi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 BSPModel *v31; // ecx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 ODMFace *v32; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 int v33; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 int v34; // ecx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 int v35; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 Actor *v36; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 __int16 v37; // ax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 int v39; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 unsigned __int64 v40; // qax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 int v41; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 unsigned __int8 v42; // sf@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 unsigned __int8 v43; // of@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 int v44; // eax@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 __int16 v45; // bx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 int v46; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 const char *v47; // [sp-8h] [bp-B0h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 enum TEXTURE_TYPE v48; // [sp-4h] [bp-ACh]@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 int v49; // [sp+Ch] [bp-9Ch]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 int v50; // [sp+10h] [bp-98h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 Vec3_int_ v51; // [sp+14h] [bp-94h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 Particle_ Dst; // [sp+20h] [bp-88h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 unsigned int uLayingItemID_; // [sp+88h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 int v54; // [sp+8Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 int v55; // [sp+90h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 int v56; // [sp+94h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 int v57; // [sp+98h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 int v58; // [sp+9Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 int v59; // [sp+A0h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 Actor *v60; // [sp+A4h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 v57 = GetTerrainHeightsAroundParty(v1->vPosition.x, v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 v3 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 v4 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 v5 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 v6 = sub_46D49E_prolly_get_world_y_under_party(v4, v3, v1->vPosition.z, v5, &v59, &v55, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 v54 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 v8 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 if ( v1->vPosition.z <= v6 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 if ( v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 v9 = v6 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 v9 = v7 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 v58 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 if ( !(v10 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 if ( v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 v11 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 v12 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 _46DCC8_get_gravity_direction_outdoor(v12, v11, &v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 v56 = abs(v51.y * v1->vVelocity.y + v51.z * v1->vVelocity.z + v51.x * v1->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 v1->vVelocity.x += (unsigned int)(v56 * v51.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 v1->vVelocity.y += (unsigned int)(v56 * v51.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 v1->vVelocity.z += (unsigned int)(v56 * v51.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 if ( v10 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 if ( !(v2->uFlags & 0x80) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 v60 = (Actor *)v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 v60 = (Actor *)((unsigned __int64)(58500i64 * (signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 v1->vVelocity.x = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 v60 = (Actor *)v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 v1->vVelocity.y = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 v60 = (Actor *)v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 v22 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 v1->vVelocity.z = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 if ( v1->vVelocity.y * v1->vVelocity.y + v22 * v22 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 v23 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 if ( HIBYTE(v23) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 v47 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 if ( HIBYTE(v23) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 Dst.uDiffuse = rand();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1930 Dst.timeToLive = 64;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 LABEL_89:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 v47 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1944 Dst.timeToLive = (unsigned __int8)(v24 & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v47, v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 if ( v1->vPosition.z > v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 && (v13 = v1->vPosition.x, v13 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 && v13 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 && (v14 = v1->vPosition.y, v14 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 && v14 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 && v1->vPosition.z <= 13000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 || !(v2->uFlags & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 LABEL_92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 stru_721530.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 stru_721530.field_C = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 stru_721530.field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 v15 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 stru_721530.field_34.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 stru_721530.normal.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 stru_721530.field_34.z = v1->vPosition.z + stru_721530.prolly_normal_d + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 if ( stru_721530._47050A(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 _46E889_collide_against_bmodels(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 v16 = WorldPosToGridCellZ(v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 v17 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 v58 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 v18 = WorldPosToGridCellX(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 _46E26D_collide_against_sprites(v18, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 _46EF01_collision_chech_player(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 if ( (v1->field_58 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 v19 = v1->field_58 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 if ( v19 < (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 v60 = pActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 v20 = &pActors[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 if ( v20->GetActorsRelation(v60) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 _46DF1A_collide_against_actor(v56, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 ++v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 while ( v56 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 v27 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 stru_721530.normal2.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 stru_721530.normal2.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 v2->uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 &v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 &v50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 if ( v59 && v26 < v27 + 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 v44 = v27 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 v44 = v54 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 v45 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 if ( HIBYTE(v45) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 if ( HIBYTE(v45) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 v46 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 Dst.uDiffuse = v46;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
2069 Dst.timeToLive = 64;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 v28 = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 v29 = v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 v1->uSectorID = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 if ( v2->uFlags & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 if ( v29 < v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 v1->vPosition.z = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 v30 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 v32 = &v31->pFaces[v30 & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 if ( v32->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 v56 = abs(v32->pFacePlane.vNormal.z * v1->vVelocity.z + v32->pFacePlane.vNormal.y * v1->vVelocity.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 + v32->pFacePlane.vNormal.x * v1->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 if ( stru_721530.field_64 >> 3 > v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 v56 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 v57 = v32->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 v58 = v32->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 v60 = (Actor *)v32->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 v1->vVelocity.x += 2 * v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 v1->vVelocity.y += 2 * v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 if ( v32->pFacePlane.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 v37 = 2 * (short)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 v36 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 v57 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 v1->vVelocity.z += (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 v58 = (unsigned __int64)(v57 * (signed __int64)(signed int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 v37 = (unsigned int)(v57 * (int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 v1->vVelocity.z += v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 if ( BYTE3(v32->uFaceAttributes) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 EventProcessor(v32->sCogTriggeredID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 v34 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 v1->vPosition.z = v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 if ( v1->vVelocity.y * v1->vVelocity.y + v34 * v34 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 LOWORD(v35) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 v58 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 v58 = (unsigned __int64)(58500i64 * v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 v1->vVelocity.x = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 v58 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 v1->vVelocity.y = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 v58 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 v43 = __OFSUB__(v55, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 v42 = v55 - 100 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 v1->vVelocity.z = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 if ( !(v42 ^ v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 v57 = sub_452A9E(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 v38 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 v1->vPosition.x - pLevelDecorations[v30].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 v1->vPosition.y - pLevelDecorations[v30].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 v56 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 v39 = stru_5C6E00->SinCos(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 v60 = (Actor *)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 v40 = v39 * (signed __int64)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 v58 = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 v1->vVelocity.x = WORD1(v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 v41 = stru_5C6E00->SinCos(v56 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 v60 = (Actor *)v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 v58 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 v1->vVelocity.y = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 //----- (0047253E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 void __cdecl UpdateObjects()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 unsigned int v0; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 __int16 v3; // dx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 ObjectDesc *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 int v5; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 __int16 v6; // cx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 signed int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 __int16 v8; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 unsigned int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 signed int v11; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 int v12; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 int v14; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 unsigned int v15; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 unsigned int v16; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 unsigned int v17; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 int v18; // [sp+4h] [bp-10h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 int v19; // [sp+8h] [bp-Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 signed int v20; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2217 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 v2 = (char *)&pLayingItems[0].uSpriteFrameID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 LOWORD(v0) = *((short *)v2 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 if ( v0 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 v0 &= 0xFFFFFFBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 *((short *)v2 - 2) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 v3 = *((short *)v2 - 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 v4 = &pObjectList->pObjects[*((short *)v2 - 14)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 if ( (v0 & 0x80u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 v5 = *(int *)(v2 + 62) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 *(int *)(v2 - 26) = pActors[v5].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 *(int *)(v2 - 22) = pActors[v5].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 if ( !v3 || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 if ( v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 v7 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 v7 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 if ( v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 v8 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 *(short *)v2 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 v9 = v4->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 if ( !(v9 & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 if ( v8 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 LayingItem::_42F933(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 v11 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 v11 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 if ( v8 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 LayingItem::UpdateObject_fn0_BLV(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 LayingItem::UpdateObject_fn0_ODM(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 if ( pParty->bTurnBasedModeOn != 1 || !(*(v2 - 4) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 v12 = abs(pParty->vPosition.x - *(int *)(v2 - 26));
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2276 v18 = abs(pParty->vPosition.y - *(int *)(v2 - 22));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2277 v19 = abs(pParty->vPosition.z - *(int *)(v2 - 18));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 v14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 v15 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 if ( v12 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 v13 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 v14 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 if ( v13 < v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 v16 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 v13 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 if ( v14 < (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 v0 = (unsigned int)(11 * v14) >> 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 if ( (signed int)(v0 + (v15 >> 2) + v13) <= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 v10 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 if ( !(v9 & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 _46BFFA_check_object_intercept(v1, 8 * v1 | OBJECT_Item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 v2 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 v1 = v20++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 while ( v20 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 //----- (0047272C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 int __fastcall _47272C_collide_agains_some_secotors_floors(int x, int y, int z, unsigned int *pSectorID, int *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 signed int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 int v7; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 signed int v8; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 v5 = x - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 v7 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 v8 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 *pSectorID = pIndoor->GetSector(v7 + 2, v8, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 result = _46ED1B_collide_against_floor(v7 + 2, v8, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 *pSectorID = pIndoor->GetSector(v7, v8 - 2, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 result = _46ED1B_collide_against_floor(v7, v8 - 2, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 *pSectorID = pIndoor->GetSector(v7, v8 + 2, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 result = _46ED1B_collide_against_floor(v7, v8 + 2, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 *pSectorID = pIndoor->GetSector(v7, v8, z + 140);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 result = _46ED1B_collide_against_floor(v7, v8, z + 140, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 //----- (00472866) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 void __cdecl BLV_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 float v4; // ST40_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 Player **v5; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 int v6; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 Player **v7; // esi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 signed __int64 v8; // qax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 int v9; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 double v10; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 BLVFace *v11; // edx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 unsigned int v12; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 double v13; // st7@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 int v14; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 signed __int64 v15; // qax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 double v16; // st7@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 int v17; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 double v18; // st7@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 int v19; // ST40_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 int v20; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 double v21; // st7@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 int v22; // ST40_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 int v23; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 double v24; // st7@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 int v25; // ST40_4@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 int v26; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 double v27; // st7@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 int v28; // ST40_4@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 double v30; // st7@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 int v31; // ST3C_4@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 int v32; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 double v33; // st7@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 int v34; // ST3C_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 unsigned int v35; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 int v36; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 int v37; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 int v38; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 int v39; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 int v40; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 Player **v41; // esi@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 int v42; // eax@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 signed int v43; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 BLVFace *v44; // esi@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 PolygonType v45; // al@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 int v46; // ecx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 char v47; // zf@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 int v48; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 int v49; // ST40_4@136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 int v50; // ST40_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 int v51; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 int v52; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 signed int v53; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 int v54; // ebx@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 int v55; // ST30_4@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 AudioPlayer *v56; // ecx@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 SoundID v57; // [sp-20h] [bp-80h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 signed int v58; // [sp-1Ch] [bp-7Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 unsigned int v59; // [sp-18h] [bp-78h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 signed int v60; // [sp-14h] [bp-74h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 signed int v61; // [sp-10h] [bp-70h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 int v62; // [sp-Ch] [bp-6Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 int v63; // [sp-8h] [bp-68h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 unsigned int v64; // [sp-8h] [bp-68h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 int v65; // [sp-4h] [bp-64h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 int v66; // [sp-4h] [bp-64h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 double v67; // [sp+Ch] [bp-54h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 int v68; // [sp+10h] [bp-50h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 int v69; // [sp+10h] [bp-50h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 int v70; // [sp+14h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 signed int v71; // [sp+18h] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 signed int v72; // [sp+1Ch] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 signed int v73; // [sp+20h] [bp-40h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 int v74; // [sp+20h] [bp-40h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 signed int bFeatherFall; // [sp+24h] [bp-3Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 bool bFeatherFalla; // [sp+24h] [bp-3Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 unsigned int v77; // [sp+28h] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 int v78; // [sp+2Ch] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 int v79; // [sp+30h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 int i; // [sp+34h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 int v81; // [sp+38h] [bp-28h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 int v82; // [sp+3Ch] [bp-24h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 int v83; // [sp+40h] [bp-20h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 int bJumping; // [sp+44h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 int v85; // [sp+48h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 int v86; // [sp+4Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 int v87; // [sp+50h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 float v88; // [sp+54h] [bp-Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 int v89; // [sp+58h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448 int angle; // [sp+5Ch] [bp-4h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2450 v0 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 v89 = pParty->uFallSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 v1 = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2453 v85 = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 v86 = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2457 v87 = pParty->vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2458 v77 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 bJumping = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 v3 = v0 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 i = _46ED1B_collide_against_floor(v86, v85, v3, &v77, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 if ( i == -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 i = _47272C_collide_agains_some_secotors_floors(v86, v85, v3, &v77, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 if ( i == -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 pParty->vPosition.x = blv_prev_party_x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2477 pParty->vPosition.y = blv_prev_party_z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2478 pParty->vPosition.z = blv_prev_party_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 pParty->uFallStartY = blv_prev_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 blv_prev_party_x = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2484 blv_prev_party_z = pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2485 blv_prev_party_y = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 if ( pParty->bTurnBasedModeOn != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 v4 = (double)(GetTickCount() / 0x1F4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2489 v67 = v4 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2490 if ( *(int *)&word_720C10_intercepts_xs[102] != LODWORD(v67) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2492 dword_4F8584[3 * dword_4F8580[0]] = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2493 dword_4F8588[3 * dword_4F8580[0]] = pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2494 dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 if ( dword_4F8580[0] > 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 dword_4F8580[0] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 *(int *)&word_720C10_intercepts_xs[102] = LODWORD(v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 v5 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 while ( !(*v5)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 if ( (signed int)v5 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 v6 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 v6 = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2517 pParty->uFallStartY = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 if ( v6 - v87 > 512 && !bFeatherFall && v87 <= i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 v7 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 if ( !(*v7)->HasEnchantedItemEquipped(72) && !(*v7)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 v8 = (signed __int64)((double)(*v7)->GetMaxHealth() * 0.1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2533 (*v7)->ReceiveDamage((pParty->uFallStartY - v87) * (signed int)v8 / 256, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 v9 = (*v7)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 v10 = (double)(20 - (*v7)->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 (*v7)->SetRecoveryTime((signed __int64)v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 while ( (signed int)v7 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 if ( v87 > i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 bFeatherFalla = v87 - i <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 if ( v87 - i <= 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 if ( bWalkSound && pParty->field_6F8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 if ( v87 > i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 v87 = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 pParty->uFallStartY = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 if ( pParty->field_6F4_packedid != v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 v11 = &pIndoor->pFaces[v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 if ( BYTE3(v11->uAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 v70 = pIndoor->pFaceExtras[v11->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 pParty->field_6F4_packedid = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 if ( pIndoor->pFaces[v79].uAttributes & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 v71 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 v81 = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 angle = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 v83 = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 / 180)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 v13 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 v16 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 v14 = angle + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 v13 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 v14 = angle + (unsigned __int64)(signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 angle = stru_5C6E00->uDoublePiMask & v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 v16 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 v15 = (signed __int64)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 angle = stru_5C6E00->uDoublePiMask & (angle - v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 v18 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 v88 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v19 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 v21 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 v88 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 v22 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 goto LABEL_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 v23 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 v24 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 v88 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v88 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 v1 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 v26 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 v27 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 v88 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 v78 = (unsigned __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 v78 = (unsigned __int64)(v28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 LABEL_68:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 v1 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 v29 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 v30 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 v88 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 v2 += (unsigned __int64)(v29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 * (unsigned __int64)(signed __int64)(v30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 v1 += (unsigned __int64)(v31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 * (unsigned __int64)(signed __int64)(v88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 v32 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 v33 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 v88 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 v2 -= (unsigned __int64)(v32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 * (signed __int64)(signed int)(signed __int64)(v33 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 v1 -= (unsigned __int64)(v34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 v72 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 if ( v83 > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 v83 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 v63 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 if ( v83 < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 v83 = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 v63 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 pPlayers[v35]->PlaySound(v63, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 if ( (!bJumping || v87 <= i + 6 && v89 <= 0) && pParty->field_24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 v89 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 pParty->sRotationY = angle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 pParty->sRotationX = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 v89 += -2 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 v89 -= pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 if ( bJumping != v36 && v89 <= v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 if ( v89 < -500 && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 (*v41)->PlayEmotion(46, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 LABEL_92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 v37 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 stru_721530.field_34.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 stru_721530.normal.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 stru_721530.field_34.y = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 stru_721530.normal.y = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 stru_721530.field_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 stru_721530.normal.z = stru_721530.prolly_normal_d + v87 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 stru_721530.field_34.z = stru_721530.field_C + v87 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 stru_721530.field_24 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 stru_721530.uSectorID = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2794 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 v38 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 if ( stru_721530._47050A(v38) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 _46E44E_collide_against_faces_and_portals(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 while ( v73 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 v39 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813 v77 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16) + v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 v77 = v85 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 v40 = v37 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 v42 = _46ED1B_collide_against_floor(v39, v77, v40 + 40, &stru_721530.uSectorID, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 if ( v42 == -30000 || v42 - v37 > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 v86 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 v85 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 v37 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 v86 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 v85 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 v77 = stru_721530.uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 v53 = sub_452A9E(v2 * v2 + v1 * v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 i = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 v54 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 v86 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 v85 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 v1 = (unsigned __int64)(v55 * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 v45 = v44->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 if ( v45 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 if ( v89 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 v87 = pIndoor->pVertices[*v44->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 if ( pParty->uFallStartY - v87 < 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2870 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 goto LABEL_143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 v46 = v89 * v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 v47 = v45 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 v48 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 if ( stru_721530.field_64 >> 3 > i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 i = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 v50 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 v81 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 v82 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 v2 += v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 v74 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2893 v51 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 v69 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 i = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 v52 = stru_721530.prolly_normal_d - ((v44->pFacePlane_old.dist + v87 * v74 + v85 * v51 + v86 * v69) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 if ( v52 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 v86 += v52 * v69 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 v85 += v52 * i >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 v87 += v52 * v74 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 LABEL_142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 LABEL_143:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 v70 = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 if ( stru_721530.field_64 >> 3 > i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 i = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 v49 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 v81 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 v82 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 v2 += v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 if ( v2 * v2 + v1 * v1 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 goto LABEL_142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 v1 = (unsigned __int64)(58500i64 * v1) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 ++v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 v89 = (unsigned __int64)(58500i64 * v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 if ( v83 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 v37 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2942 if ( sub_452A9E((pParty->vPosition.x - v86) * (pParty->vPosition.x - v86) + (pParty->vPosition.y - v85)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2943 * (pParty->vPosition.y - v85)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2944 + (pParty->vPosition.z - v37)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2945 * (pParty->vPosition.z - v37)) <= 16 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 goto LABEL_188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 if ( v72 && (!bJumping || bFeatherFalla) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 v57 = (SoundID)50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 v57 = (SoundID)64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 v57 = (SoundID)63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 if ( v78 && (!bJumping || bFeatherFalla) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 if ( v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 v57 = (SoundID)102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 v57 = (SoundID)89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 v57 = (SoundID)103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 LABEL_188:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 if ( !bJumping || bFeatherFalla )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 BYTE1(pParty->uFlags) &= 0xFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 pParty->vPosition.x = v86;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3005 pParty->vPosition.z = v37;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3006 pParty->vPosition.y = v85;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 pParty->uFallSpeed = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 if ( !bJumping && BYTE3(pIndoor->pFaces[v79].uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 BYTE1(pParty->uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 if ( v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 EventProcessor(v70, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 //----- (00473893) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 void __cdecl ODM_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 int _zero; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 int v3; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 Player **v4; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 int v5; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 int v6; // esi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 ODMFace *v7; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 unsigned int v8; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 double v9; // st7@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 signed __int64 v10; // qax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 double v11; // st7@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 int v12; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 int v13; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 double v14; // st7@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 int v15; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 double v16; // st7@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 int v17; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 double v18; // st7@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 int v19; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 double v20; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 int v21; // eax@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 double v22; // st7@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 int v23; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 double v24; // st7@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 int v25; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 double v26; // st7@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 int v27; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 double v28; // st7@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 signed __int64 v29; // qax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 unsigned int v30; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 int v31; // eax@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 int v32; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 signed int v33; // eax@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 int v34; // esi@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 unsigned int v35; // esi@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 int v36; // eax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 signed int v37; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 signed int v38; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 signed int i; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 int v40; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 Player **v41; // esi@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 bool v42; // eax@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 signed int v43; // ecx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 signed int v44; // edx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 int v45; // ecx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 BSPModel *v46; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 ODMFace *v47; // esi@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 int v48; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 char v49; // zf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 char v50; // sf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 unsigned __int8 v51; // of@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 int v52; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 unsigned __int8 v53; // dl@205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 BSPModel *v54; // eax@215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 int v55; // eax@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 signed int v56; // ebx@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 int v57; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 BSPModel *v58; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 unsigned __int64 v59; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 BSPModel *v60; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 unsigned __int64 v61; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 int v62; // eax@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 signed int v63; // ST04_4@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 signed int v64; // eax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 unsigned int v65; // ebx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 unsigned int v66; // esi@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 int v67; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 signed int v68; // ecx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 int v69; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 int v70; // ebx@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 int v71; // esi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 int v72; // edi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 int v73; // eax@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 Player **v74; // esi@283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 int v75; // eax@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 unsigned int v76; // edi@293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 bool v77; // edx@297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 bool v78; // ecx@303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 int v79; // ecx@314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 __int16 v80; // dx@317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 int v81; // ebx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 int v82; // ecx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 int v83; // eax@321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 Player **v84; // esi@333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 int v85; // eax@334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 int v86; // [sp-20h] [bp-B4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 int v87; // [sp-20h] [bp-B4h]@248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 signed int v88; // [sp-1Ch] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 unsigned int v89; // [sp-18h] [bp-ACh]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 signed int v90; // [sp-14h] [bp-A8h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 signed int v91; // [sp-10h] [bp-A4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 int v92; // [sp-Ch] [bp-A0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 int v93; // [sp-8h] [bp-9Ch]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 unsigned int v94; // [sp-8h] [bp-9Ch]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 int v95; // [sp-4h] [bp-98h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 int v96; // [sp-4h] [bp-98h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 int v97; // [sp+Ch] [bp-88h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 int v98; // [sp+10h] [bp-84h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 int v99; // [sp+14h] [bp-80h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 int v100; // [sp+18h] [bp-7Ch]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 bool v101; // [sp+1Ch] [bp-78h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 int v102; // [sp+20h] [bp-74h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 int v103; // [sp+24h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 int bFeatherFall; // [sp+28h] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 int v105; // [sp+2Ch] [bp-68h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 int bWaterWalk; // [sp+30h] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 bool v107; // [sp+34h] [bp-60h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 int v108; // [sp+38h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 int v109; // [sp+3Ch] [bp-58h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 int v110; // [sp+40h] [bp-54h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 int v111; // [sp+44h] [bp-50h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 int bJumping; // [sp+48h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 int v113; // [sp+4Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 unsigned int v114; // [sp+50h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133 int _walk_speed; // [sp+54h] [bp-40h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 int v116; // [sp+58h] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 int v117; // [sp+5Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 int v118; // [sp+60h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 Player **v119; // [sp+64h] [bp-30h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 int _angle_x; // [sp+68h] [bp-2Ch]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 int v121; // [sp+6Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 unsigned int v122; // [sp+70h] [bp-24h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 int v123; // [sp+74h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 int v124; // [sp+78h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 int _angle_y; // [sp+7Ch] [bp-18h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 int v126; // [sp+80h] [bp-14h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 BSPModel *v127; // [sp+84h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 int v128; // [sp+88h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 int v129; // [sp+8Ch] [bp-8h]@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 int v130; // [sp+90h] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 v121 = pParty->uFallSpeed;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3151 v123 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 v103 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 v116 = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3158 v117 = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 bJumping = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3161 v118 = GetTerrainHeightsAroundParty(pParty->vPosition.x, pParty->vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 v102 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 v119 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 while ( !(*v119)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 if ( (signed int)v119 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 if ( (signed __int64)pParty->pPartyBuffs[18].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 bWaterWalk = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 if ( !(pParty->pPartyBuffs[18].uFlags & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 && *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[18].uCaster + 10] <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 v3 = sub_46D49E_prolly_get_world_y_under_party(v116, v117, v123, pParty->uPartyHeight, &v130, &v108, bWaterWalk);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 v111 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 if ( bFeatherFall )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 pParty->uFallStartY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 v3 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 v4 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 if ( !(*v4)->HasEnchantedItemEquipped(72) && !(*v4)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 v105 = (*v4)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 (*v4)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(signed __int64)((double)v105 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 v5 = (*v4)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 v105 = 20 - (*v4)->_48EA1B_get_static_effect(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 (*v4)->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 while ( (signed int)v4 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 if ( pParty->bFlying != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 v107 = v108 == _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 v105 = v111 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 if ( v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 v101 = v123 - v111 <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 if ( bWalkSound != _zero && pParty->field_6F8 > _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 if ( !bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < _zero || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 if ( bJumping == _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 if ( pParty->field_6F4_packedid != (8 * v108 | OBJECT_BModel) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 if ( v108 != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 if ( v108 >> 6 < pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 v7 = (ODMFace *)&pOutdoor->pBModels[v108 >> 6].pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 v6 = v108 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 if ( *(char *)(v7->pFacePlane.vNormal.x + 308 * v6 + 31) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 _walk_speed = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 _angle_y = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 _angle_x = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 v126 = pEventTimer->dt_in_some_format;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 / 180)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 LABEL_118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 case PARTY_FlyUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3290 if ( pParty->vPosition.z < 4000 || bJumping )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 v123 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 v113 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 if ( v123 > 4000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 v123 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 v113 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 if ( v102 && v123 < v109 && (signed int)(pParty->uPartyHeight + v123) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 pParty->field_6E0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 pParty->field_6E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 BYTE1(pParty->uFlags) |= 1u;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3310 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 pParty->field_6F0 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 v123 = v109 - pParty->uPartyHeight - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 case PARTY_FlyDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 v123 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 v113 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 if ( v123 <= v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 v9 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 v11 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 v12 = v8 + _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 _angle_y = stru_5C6E00->uDoublePiMask & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 v9 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 _angle_y = stru_5C6E00->uDoublePiMask & (_angle_y + (unsigned __int64)(signed __int64)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 v11 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 v10 = (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v12 = _angle_y - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 v13 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v14 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 *(float *)&v128 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 v124 = (unsigned __int64)(v13 * (signed __int64)((signed int)(signed __int64)(v14 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v15 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 v16 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 v126 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 *(float *)&v128 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 v124 = (unsigned __int64)(v15 * (signed __int64)((signed int)(signed __int64)(v16 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 v126 = stru_5C6E00->SinCos(_angle_y);
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 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 v17 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 v18 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 v126 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 *(float *)&v128 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 v124 = (unsigned __int64)(v17 * (signed __int64)(signed int)(signed __int64)(v18 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 v1 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 v19 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 v20 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 v126 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 *(float *)&v128 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 v124 = (unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 * (signed __int64)(signed int)(signed __int64)(v20 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 v1 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 v21 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 v22 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 v126 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 *(float *)&v128 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 v129 = (unsigned __int64)(v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 * (unsigned __int64)(signed __int64)(v22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 if ( v118 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 v23 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 v24 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 v126 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 *(float *)&v128 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 v129 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 v25 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 v26 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 v114 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 *(float *)&v128 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 v129 = (unsigned __int64)(v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 * (unsigned __int64)(signed __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 v114 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 v129 = (unsigned __int64)((signed int)v114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 v27 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 v28 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 v126 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 *(float *)&v128 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 v29 = (signed __int64)(v28 * fBackwardMovementSlowdownMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 * fBackwardMovementSlowdownMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 v124 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 if ( _angle_x > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 _angle_x = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 v93 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 goto _play_player_sound;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 if ( _angle_x < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 _angle_x = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 v93 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 _play_player_sound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 pPlayers[v30]->PlaySound(v93, v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 _angle_x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 if ( (!v118 || v108) && !bJumping && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 v126 = pParty->field_24 << 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 v121 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v121);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 case PARTY_Land:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 BYTE1(pParty->uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 LABEL_123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 pParty->sRotationY = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 pParty->sRotationX = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 if ( v123 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 LABEL_130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 v31 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 v126 = stru_5C6E00->SinCos(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 v129 = (unsigned __int64)(4i64 * v126) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 v123 = v113 + v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 v123 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 goto LABEL_141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 if ( v130 && v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 sub_42F960_create_object(v116, v117, v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 pParty->uFallStartY = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 v113 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 LABEL_141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 if ( bJumping && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 v34 = v121 + 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 v121 += 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 if ( !v118 )
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_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 if ( bJumping == v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 goto LABEL_164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 if ( !bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 if ( v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 _46DCC8_get_gravity_direction_outdoor(v116, v117, (Vec3_int_ *)&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621 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
3622 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 v2 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v99) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 v1 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v100) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 v34 = (int)((char *)v127 + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 v121 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 LABEL_164:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 if ( !bUnderwater && v34 <= v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 if ( v34 < -500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 && !pParty->bFlying
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3639 && pParty->vPosition.z - v111 > 1000
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 v41 = &pPlayers[1];
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 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) && (*v41)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 (*v41)->PlaySound(66, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 LABEL_150:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 if ( v2 * v2 + v1 * v1 < 400 && !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 v126 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 stru_721530.field_34.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 stru_721530.normal.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 stru_721530.field_34.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 stru_721530.normal.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 stru_721530.normal.z = stru_721530.prolly_normal_d + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 stru_721530.field_34.z = stru_721530.field_C + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 stru_721530.field_20 = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 stru_721530.field_24 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 v36 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 if ( stru_721530._47050A(v36) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 _46E889_collide_against_bmodels(1u);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3687 v37 = WorldPosToGridCellZ(pParty->vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 v38 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 _46E26D_collide_against_sprites(v38, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690 _46ED8A_collide_against_layingItems(4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 _angle_x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 _angle_y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 _angle_x = v116 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 _angle_y = v117 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 v127 = (BSPModel *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 v40 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 v122 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 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
3708 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
3709 v119 = (Player **)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 v116,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 &v110,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 v127 = (BSPModel *)GetTerrainHeightsAroundParty(_angle_x, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 v42 = GetTerrainHeightsAroundParty(v116, _angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 v118 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 if ( !v97 && !v110 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 v107 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 if ( bUnderwater || !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 if ( v127 && v129 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 if ( v118 && (signed int)v119 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 goto LABEL_198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 v127 = (BSPModel *)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 _angle_x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 &v108,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 if ( GetTerrainHeightsAroundParty(_angle_x, _angle_y) && (signed int)v127 <= v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 goto LABEL_199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 LABEL_198:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 LABEL_199:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 v116 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 v117 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 v123 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 v123 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 v56 = sub_452A9E(v2 * v2 + v128 * v128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 v118 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 v57 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 v129 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 v58 = (BSPModel *)stru_5C6E00->SinCos(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 v127 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 v59 = (signed int)v58 * (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 v122 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 v2 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 v60 = (BSPModel *)stru_5C6E00->SinCos(v129 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 v127 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 v61 = (signed int)v60 * (signed __int64)v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 v122 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 v128 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 v127 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 v48 = v47->pBoundingBox.z2 - v47->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 v51 = __OFSUB__(v48, 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 v49 = v48 == 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 v50 = v48 - 32 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 v52 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 v129 = (unsigned __int8)(v50 ^ v51 | v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 v119 = (Player **)(v52 < 46378);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 v53 = v47->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3814 if ( v53 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3816 if ( v121 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 v123 = v127->pVertices.pVertices[v47->pVertexIDs[0]].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 if ( v2 * v2 + v128 * v128 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 goto LABEL_221;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 if ( !v129 && (v53 != 4 || v119) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 v129 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 _walk_speed = v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 _walk_speed = (unsigned __int64)(v118 * (signed __int64)_walk_speed) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 v127 = (BSPModel *)v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 v54 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 v121 += (int)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 v128 += _walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 v55 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 - ((signed int)(v47->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 + v122 * v47->pFacePlane.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 + _angle_y * v47->pFacePlane.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 + _angle_x * v47->pFacePlane.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 if ( v55 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 v116 = _angle_x + (v47->pFacePlane.vNormal.x * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 v117 = _angle_y + (v47->pFacePlane.vNormal.y * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 v123 = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 LABEL_220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 LABEL_221:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uFaceAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 pParty->field_6F4_packedid = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 v103 = v47->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 v122 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 v127 = (BSPModel *)v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 v129 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 v121 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 v2 += v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 v128 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 if ( v2 * v2 + v128 * v128 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 goto LABEL_220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 v127 = (BSPModel *)58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 v122 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 ++v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 v121 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 while ( v126 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 v122 = abs(pParty->vPosition.x - v116);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3898 v126 = abs(pParty->vPosition.y - v117);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3899 v62 = abs(pParty->vPosition.z - v123);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 goto LABEL_344;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 if ( v114 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 if ( !v107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 v87 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 v86 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 LABEL_255:
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3926 v63 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v64 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 v87 = pOutdoor->_47EE49(v64, v63, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 if ( v124 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 if ( v107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 v87 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 LABEL_257:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 pAudioPlayer->PlaySound((SoundID)v87, v88, v89, v90, v91, v92, v94, v96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 LABEL_344:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 if ( !bJumping || v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 v126 = WorldPosToGridCellX(pParty->vPosition.x);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3969 v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 v114 = WorldPosToGridCellX(v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 v66 = WorldPosToGridCellZ(v117) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 v122 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v114, v65) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 v69 = ((unsigned int)~v67 >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 if ( v114 == v126 && v66 == v65 && v122 && v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 if ( v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 v70 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 v71 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 v72 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 v73 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 pParty->vPosition.x = v116;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3989 pParty->vPosition.y = v117;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3990 pParty->vPosition.z = v123;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 v73 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 pParty->uFallStartY = 8160;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3996 pParty->vPosition.z = 8160;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4000 && pParty->vPosition.y == v72
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4001 && (v73 = pParty->vPosition.z, pParty->vPosition.z == v70) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 if ( v73 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 v73 = v105;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4007 pParty->vPosition.z = v105;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 v74 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 v110 = (*v74)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 (*v74)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 (signed int)((pParty->uFallStartY - v70) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 v75 = (*v74)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 v110 = 20 - (*v74)->_48EA1B_get_static_effect(v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 (*v74)->SetRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 while ( (signed int)v74 <= (signed int)&pPlayers[4] );
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4030 v73 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 pParty->uFallStartY = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 if ( v102 && v73 < v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4039 pParty->vPosition.z = v109 - pParty->uPartyHeight - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 v76 = pParty->bFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 if ( pParty->bFlying || v101 == 0 || bWaterWalk || !v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 v77 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 v77 = v122 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 if ( !pParty->bFlying && v101 != 0 && !bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 v78 = v69 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 goto LABEL_306;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 LABEL_306:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 if ( v77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 pParty->vPosition.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 goto LABEL_313;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 goto LABEL_312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 if ( v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 LABEL_312:
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4074 pParty->vPosition.y = v117;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 LABEL_313:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 if ( bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4081 if ( !v122 || !v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 if ( !v76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 v80 = *(short *)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 LOBYTE(pParty->uFlags) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 *(short *)v79 = v80 & 0xFFFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 goto LABEL_318;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 LABEL_318:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 v81 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 v82 = v123;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4101 pParty->vPosition.z = v123;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 v82 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 pParty->uFallStartY = 8160;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4106 pParty->vPosition.z = 8160;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4113 v83 = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v110, 1);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4114 v82 = pParty->vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4115 if ( pParty->vPosition.z <= v83 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 pParty->uFlags |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v116)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4120 && pParty->vPosition.y == v117
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4121 && (v82 = pParty->vPosition.z, pParty->vPosition.z == v81) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 if ( v82 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 pParty->uFallSpeed = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4127 pParty->vPosition.z = v105;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 v84 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 v110 = (*v84)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 (*v84)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 (signed int)((pParty->uFallStartY - v81) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 v85 = (*v84)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 while ( (signed int)v84 <= (signed int)&pPlayers[4] );
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4149 v82 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 pParty->uFallStartY = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4156 pParty->vPosition.z = v82 + pParty->uPartyHeight - v109 + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 //----- (0047531C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 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
4168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 BLVFace *v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 int v11; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 int v12; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 int v13; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 int v14; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 signed __int64 v15; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 __int16 v16; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 int *v18; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 int v19; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 int a9b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 int a9a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 int a10b; // [sp+3Ch] [bp+24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 signed int a10a; // [sp+3Ch] [bp+24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 int a10c; // [sp+3Ch] [bp+24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 v10 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 v19 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 if ( a10 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 v11 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 a10b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 a9b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 v12 = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 a9a = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 v13 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 - a5 * v10->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 - v10->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 - a5 * v10->pFacePlane_old.vNormal.z - v10->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 a10c = abs(v13) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 if ( a10c > abs(v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 LODWORD(v15) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 HIDWORD(v15) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 v14 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 a10a = v15 / a9a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 a10a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 v14 = abs(v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 v16 = a4 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 HIWORD(a7a) = v16 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 if ( !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 *v18 = a10a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 if ( a10a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 //----- (004754BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 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
4238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 BLVFace *v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 int v12; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 int v13; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 int v14; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 int v15; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 signed __int64 v16; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 __int16 v17; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 int *v19; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 int v20; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 int a1b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 int a1a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 int a11b; // [sp+40h] [bp+28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 signed int a11a; // [sp+40h] [bp+28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 int a11c; // [sp+40h] [bp+28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 v11 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 v19 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 v20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 if ( a11 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 v12 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 a11b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 a1b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 v13 = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 a1a = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 v14 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 - a5 * v11->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 - v11->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 - a5 * v11->pFacePlane_old.vNormal.z - v11->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 a11c = abs(v14) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 if ( a11c > abs(v13) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 LODWORD(v16) = v14 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 HIDWORD(v16) = v14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 v15 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 a11a = v16 / a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 a11a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 v15 = abs(v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 v17 = a4 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 HIWORD(a7a) = v17 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 if ( !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 *v19 = a11a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 if ( a11a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 *v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 //----- (00475665) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 Vec3_short_ *v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 signed int v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 Vec3_short_ *v8; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 signed int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 int v10; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 signed int v11; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 Vec3_short_ *v12; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322 signed int v13; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 int v15; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 bool v16; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 signed int v18; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 int v19; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 signed int v20; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 int v21; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 signed int v22; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 signed __int64 v23; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 signed int result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 int v25; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 int v26; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 signed int v27; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 signed int v28; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 signed int v29; // [sp+30h] [bp+Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 signed int v30; // [sp+30h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 signed int v31; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 v3 = _this->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 if ( BYTE1(v3) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 v27 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 v4 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 v5 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 v6 = 2 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 word_720C10_intercepts_xs[2 * v28] = _this->pXInterceptDisplacements[v28] + v4[_this->pVertexIDs[v28]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 word_720B40_intercepts_zs[2 * v28] = _this->pYInterceptDisplacements[v5] + v4[_this->pVertexIDs[v5]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 word_720C10_intercepts_xs[2 * v28++ + 1] = _this->pXInterceptDisplacements[v5 + 1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 + v4[_this->pVertexIDs[v5 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 word_720B40_intercepts_zs[v6 + 1] = _this->pYInterceptDisplacements[v5 + 1] + v4[_this->pVertexIDs[v5 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 while ( v28 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 if ( BYTE1(v3) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 v7 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 v27 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 v8 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 v9 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 v10 = 2 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 word_720C10_intercepts_xs[2 * v29] = _this->pXInterceptDisplacements[v29] + v8[_this->pVertexIDs[v29]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 word_720B40_intercepts_zs[2 * v29] = _this->pZInterceptDisplacements[v9] + v8[_this->pVertexIDs[v9]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 word_720C10_intercepts_xs[2 * v29++ + 1] = _this->pXInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 word_720B40_intercepts_zs[v10 + 1] = _this->pZInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 while ( v29 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 v26 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 v11 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 v27 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 v12 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 v13 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 v14 = 2 * v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 word_720C10_intercepts_xs[2 * v30] = _this->pYInterceptDisplacements[v30] + v12[_this->pVertexIDs[v30]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 word_720B40_intercepts_zs[2 * v30] = _this->pZInterceptDisplacements[v13] + v12[_this->pVertexIDs[v13]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 word_720C10_intercepts_xs[2 * v30++ + 1] = _this->pYInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 word_720B40_intercepts_zs[v14 + 1] = _this->pZInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 while ( v30 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 v15 = 2 * _this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 word_720C10_intercepts_xs[2 * _this->uNumVertices] = word_720C10_intercepts_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 word_720B40_intercepts_zs[v15] = word_720B40_intercepts_zs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 v16 = word_720B40_intercepts_zs[0] >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 if ( v15 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 if ( v31 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 v17 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 v18 = word_720B40_intercepts_zs[v25 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 if ( v16 ^ v18 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 v19 = word_720C10_intercepts_xs[v17 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 if ( v19 >= v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 v21 = v20 | word_720C10_intercepts_xs[v17] < v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 if ( v21 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 if ( !v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 || (v22 = v19 - word_720C10_intercepts_xs[v17],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 LODWORD(v23) = v22 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436 HIDWORD(v23) = v22 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 word_720C10_intercepts_xs[v17]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 + ((signed int)(((unsigned __int64)(v23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 / (v18 - word_720B40_intercepts_zs[v17])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 * ((v27 - (signed int)word_720B40_intercepts_zs[v17]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 + 32768) >> 16) >= v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 v16 = v18 >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 while ( v25 < v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 if ( v31 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 //----- (004759C9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 __int16 v6; // si@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 __int16 v8; // si@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 int v9; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 __int16 v10; // si@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 int v11; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 bool v12; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 int v15; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 signed int v16; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 int v17; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 signed int v18; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 signed __int64 v19; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 bool result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 int v21; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 signed int v22; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 int v23; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 signed int v24; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 Vec3_int_ **a4a; // [sp+30h] [bp+Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 Vec3_int_ **a4b; // [sp+30h] [bp+Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 Vec3_int_ **a4c; // [sp+30h] [bp+Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 signed int a4d; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 v4 = a1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 if ( BYTE1(v4) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 v24 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 a4a = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 v5 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 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
4500 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
4501 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 if ( BYTE1(v4) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 a4b = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 v7 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 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
4521 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
4522 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 v23 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 a4c = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 v9 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 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
4540 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
4541 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 v11 = 2 * a1->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 a4d = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 word_720A70_intercepts_xs_plus_xs[2 * a1->uNumVertices] = word_720A70_intercepts_xs_plus_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 word_7209A0_intercepts_ys_plus_ys[v11] = word_7209A0_intercepts_ys_plus_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 v12 = word_7209A0_intercepts_ys_plus_ys[0] >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 if ( v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 if ( a4d >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 v13 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 v14 = word_7209A0_intercepts_ys_plus_ys[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 if ( v12 ^ v14 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 v15 = word_720A70_intercepts_xs_plus_xs[v13 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 if ( v15 >= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 v17 = v16 | word_720A70_intercepts_xs_plus_xs[v13] < v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 if ( v17 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 if ( !v17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 || (v18 = v15 - word_720A70_intercepts_xs_plus_xs[v13],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 LODWORD(v19) = v18 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 HIDWORD(v19) = v18 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 word_720A70_intercepts_xs_plus_xs[v13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 + ((signed int)(((unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 / (v14 - word_7209A0_intercepts_ys_plus_ys[v13])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 * ((v24 - (signed int)word_7209A0_intercepts_ys_plus_ys[v13]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 + 32768) >> 16) >= v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 ++a4d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 v12 = v14 >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 while ( v21 < v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 if ( a4d != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 //----- (00475D85) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 BLVFace *v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 int v5; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 int v6; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 int v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 signed int v9; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 signed __int64 v10; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 Vec3_int_ *v11; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 int v12; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 Vec3_int_ *v14; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 Vec3_int_ *v15; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 int v16; // [sp+18h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 int v17; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 int a4b; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 int a4c; // [sp+30h] [bp+Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 signed int a4a; // [sp+30h] [bp+Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 if ( BYTE3(a4->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 || (v5 = (unsigned __int64)(a2->x * (signed __int64)a4->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 a4b = (unsigned __int64)(a2->y * (signed __int64)a4->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 v6 = (unsigned __int64)(a2->z * (signed __int64)v4->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 v7 = v5 + v6 + a4b,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 (v16 = v5 + v6 + a4b) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 || v7 > 0 && !(v4->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 v8 = v4->pFacePlane_old.vNormal.z * a1->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 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
4627 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 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
4630 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 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
4638 if ( a4c > abs(v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 || (LODWORD(v10) = v9 << 16, HIDWORD(v10) = v9 >> 16, a4a = v10 / v16, v17 = v10 / v16, v17 > *a3 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 || (v11 = v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 LOWORD(v12) = LOWORD(v14->x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->x) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 HIWORD(v12) = LOWORD(v11->y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->y) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 LOWORD(v11->z) + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->z) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 *a3 = a4a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 //----- (00475F30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 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
4656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 BLVFace *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 int v10; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 int v11; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 int v12; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 char v13; // zf@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 int v14; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 signed int v16; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 int v17; // ST20_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 signed __int64 v18; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 int v19; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 int *v21; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 int v22; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 int v23; // [sp+1Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 signed int v24; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 if ( BYTE3(a2->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 || (v10 = (unsigned __int64)(a6 * (signed __int64)a2->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 v11 = (unsigned __int64)(a7 * (signed __int64)a2->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 v12 = (unsigned __int64)(a8 * (signed __int64)a2->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 v13 = v10 + v12 + v11 == 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 v14 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 v22 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 v13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 || v14 > 0 && !(a2->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 v15 = a4 * a2->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 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
4687 if ( v14 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 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
4690 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 if ( v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 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
4698 if ( v17 > abs(v14)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 || (LODWORD(v18) = v16 << 16, HIDWORD(v18) = v16 >> 16, v24 = v18 / v22, v23 = v18 / v22, v23 > *v21 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 || (LOWORD(v19) = a3 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a6) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 HIWORD(v19) = a4 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a7) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 a9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 a5 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a8) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 *v21 = v24 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 //----- (004760D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 PartyAction ActionQueue::Next()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 if (!uNumActions)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 return PARTY_INVALID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 auto result = pActions[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 for (unsigned int i = 0; i < uNumActions - 1; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 pActions[i] = pActions[i + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 --uNumActions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 //----- (00476387) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 bool __cdecl sub_476387()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 //----- (00476395) --------------------------------------------------------
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
4737 //0x26 Wizard eye at skill level 2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 signed int v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 if ( bNoNPCHiring == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 if ( (signed int)pNPCStats->uNumNewNPCs <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 if ( pParty->pHirelings[0].uProfession != uProfession )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 LOBYTE(result) = pParty->pHirelings[1].uProfession == uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 v3 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 while ( *((int *)v3 + 4) != uProfession || !(*v3 & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 if ( v2 >= (signed int)pNPCStats->uNumNewNPCs )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 // 6BE3C5: using guessed type char bNoNPCHiring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 //----- (004763E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 void __cdecl InitializeAwards()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 char v2; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 char *v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 int v4; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 signed int v5; // [sp+Ch] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 char *v6; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 Award *v7; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 if ( pAwardsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 pAllocator->FreeChunk(pAwardsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 pAwardsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 pAwardsTXT_Raw = (char *)pEvents_LOD->LoadRaw("awards.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 strtok(pAwardsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 v7 = pAwards;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4793 for (uint i = 0; i < 104; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 v5 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 v2 = v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 while ( v2 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 v4 = (int)&v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 if ( v1[(int)v3] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 *(char *)v4 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 if ( v3 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 if ( v6 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 v7->pText = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 if ( v6 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 v7->uSort = atoi(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 v1 = (char *)(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 while ( (signed int)(v6 - 1) <= 2 && (char *)v5 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4840 //while ( (signed int)v7 < (signed int)&dword_7241C8 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 // 7241C8: using guessed type int dword_7241C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 //----- (004764C2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 void __cdecl InitializeScrolls()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853 const char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 if ( pScrollsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 pAllocator->FreeChunk(pScrollsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 pScrollsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 pScrollsTXT_Raw = (char *)pEvents_LOD->LoadRaw("scroll.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861 strtok(pScrollsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 v6 = pScrolls;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4863 for (uint i = 0; i < 82; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 *v6 = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4903 //while ( (signed int)v6 < (signed int)dword_723E80_award_related );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4904 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4905
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 //----- (00476590) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 void __cdecl InitializeMerchants()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 char *v0; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4911 //char **v1; // edi@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 char *v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 char *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 signed int v6; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 char *v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 if ( pMerchantsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 pAllocator->FreeChunk(pMerchantsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 pMerchantsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 pMerchantsTXT_Raw = (char *)pEvents_LOD->LoadRaw("merchant.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 strtok(pMerchantsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4925 //v1 = (char **)pMerchantsRepairPhrases;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4926 for (uint i = 0; i < 7; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 v6 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 v2 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 v3 = v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 v5 = (int)&v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 if ( v2[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 if ( v7 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4959 pMerchantsBuyPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 if ( v7 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4965 pMerchantsSellPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 if ( v7 == (char *)3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4971 pMerchantsRepairPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 if ( v7 - 3 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4976 pMerchantsIdentifyPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 while ( (signed int)(v7 - 1) <= 4 && (char *)v6 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4985 //++v1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4986 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4987 //while ( (signed int)v1 < (signed int)pMerchantsIdentifyPhrases );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 //----- (00476682) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 void __cdecl InitializeTransitions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 if ( pTransitionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 pAllocator->FreeChunk(pTransitionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 pTransitionsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 pTransitionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("trans.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 strtok(pTransitionsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 v6 = pTransitionStrings;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5009 for (uint i = 0; i < 464; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 *v6 = (char *)RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5049 //while ( (signed int)v6 < (signed int)"awards.txt" );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 //----- (00476750) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 void __cdecl InitializeAutonotes()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 char *v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 int v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 char *v2; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 char v3; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 int v5; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 signed int v6; // [sp+0h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 if ( pAutonoteTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 pAllocator->FreeChunk(pAutonoteTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 pAutonoteTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 pAutonoteTXT_Raw = (char *)pEvents_LOD->LoadRaw("autonote.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 strtok(pAutonoteTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 v0 = (char *)&stru_723720[0].eType;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5069 for (uint i = 0; i < 195; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 v2 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 while ( v3 != 9 && v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 v3 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 v5 = (int)&v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 if ( !v2[v4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 *(char *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 if ( v1 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 *((int *)v0 - 1) = (int)RemoveQuotes(v2);
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 if ( v1 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 if ( _strcmpi(v2, "potion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 if ( _strcmpi(v2, "stat") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 if ( _strcmpi(v2, "seer") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 if ( _strcmpi(v2, "obelisk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 *(int *)v0 = 5 - (_strcmpi(v2, "teacher") != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 *(int *)v0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 *(int *)v0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 *(int *)v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 *(int *)v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 while ( v1 - 1 <= 2 && !v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 v0 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5135 //while ( (signed int)v0 < (signed int)&pScrolls[1] );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5136 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5137
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 //----- (004768A9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 void __cdecl InitializeQuests()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 int v5; // esi@9
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5148 //const char **v6; // [sp+10h] [bp-8h]@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 if ( pQuestsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 pAllocator->FreeChunk(pQuestsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 pQuestsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 pQuestsTXT_Raw = (char *)pEvents_LOD->LoadRaw("quests.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 strtok(pQuestsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5157
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5158 //v6 = pQuestTable;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5159 for (uint i = 0; i < 512; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5160 //do
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 if ( *v1 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 while ( v3 != '\t' );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 if ( v2 == 1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5192 pQuestTable[i] = RemoveQuotes(v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5198 //++v6;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5199 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5200 //while ( (signed int)v6 < (signed int)&unk_723714 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 //----- (00476977) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 void NPCStats::Initialize2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 char *v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 char v10; // dl@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 char *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 int v12; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 char *v14; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 char v15; // dl@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 int v16; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 int v17; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 char v18; // zf@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 NPCStats_stru0 *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 signed int v20; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 signed int v21; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 char *v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 char *v23; // [sp+10h] [bp-10h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 char *v25; // [sp+14h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 char *v26; // [sp+14h] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 signed int v27; // [sp+14h] [bp-Ch]@39
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5229 //signed int v28; // [sp+18h] [bp-8h]@3
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5230 //signed int v29; // [sp+18h] [bp-8h]@20
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 signed int v30; // [sp+18h] [bp-8h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 char *v31; // [sp+1Ch] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5234 //v1 = this;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5235 //v2 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5236 if (pNPCTextTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5237 pAllocator->FreeChunk(pNPCTextTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5238
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5239 //v3 = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5240 pNPCTextTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5241 strtok(pNPCTextTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5242
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5243 for (uint i = 0; i < 789; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5244 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5245 v4 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5246 v22 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5247 v25 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 if ( *v4 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 v5 = v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 while ( v5 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5262 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 v7 = (int)&v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 if ( !v4[(int)v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5266 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5267 *(char *)v7 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5268 if ( v6 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 if ( v22 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5275 pNPCTopics[i].pText = RemoveQuotes(v4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278 v4 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5280 while ( (signed int)(v22 - 1) <= 1 && v25 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5281 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5282
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5283 if (pNPCTopicTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5284 pAllocator->FreeChunk(pNPCTopicTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5285
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5286 //v8 = (char *)pEvents_LOD->LoadRaw("npctopic.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5287 pNPCTopicTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctopic.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5288 strtok(pNPCTopicTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5289
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5290 for (uint i = 0; i < 579; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5291 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5292 v9 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5293 v23 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5294 v26 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 v10 = v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 while ( v10 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5309 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311 v12 = (int)&v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 if ( !v9[(int)v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5313 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 *(char *)v12 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5315 if ( v11 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321 if ( v23 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5322 pNPCTopics[i].pTopic = RemoveQuotes(v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5327 while ( (signed int)(v23 - 1) <= 1 && v26 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5328 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5329
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5330 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5331 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5332
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5333 //v13 = (char *)pEvents_LOD->LoadRaw("npcdist.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5334 pNPCDistTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcdist.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5335 strtok(pNPCDistTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5336 strtok(nullptr, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 v30 = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5338 v31 = &array_16544[0].field_4[1];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5339
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5340 char *v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5343 v14 = strtok(nullptr, "\r") + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 v27 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5345 char *v24 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 if ( *v14 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 while ( v15 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 v2 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 if ( (signed int)v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 if ( (signed int)v2 < 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5376 array_16544[(int)v2].field_4[v30] = atoi(v14);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 *v31 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 while ( (signed int)(v2 - 1) <= 77 && !v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 if ( v30 < 59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5398 v19 = array_16544;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 v20 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 v19->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 v19->field_0 += v19->field_4[v21++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 while ( v21 < 59 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 --v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 while ( v20 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5411
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5412 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5413 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5414 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5415 pNPCDistTXT_Raw = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 //----- (00476C60) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 void NPCStats::_476C60()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 {
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5422 for (uint i = 1; i < uNumNewNPCs; ++i)
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5423 pNewNPCData[i].pName = pNPCNames2[i - 1];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5424
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5425 if (pParty->pHirelings[0].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 pParty->pHirelings[0].pName = pParty->pHireling1Name;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5427 if (pParty->pHirelings[1].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 pParty->pHirelings[1].pName = pParty->pHireling2Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 //----- (00476CB5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 void NPCStats::Initialize1()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 char *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 char *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 char v5; // dl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 char *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 char *v8; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 char v10; // dl@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 int v11; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 int v12; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 char *v13; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 char *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 char v15; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 int v16; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 int v17; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 char *v18; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 char *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 char v20; // cl@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 int v21; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 int v22; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 int v23; // [sp+Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 signed int v24; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 signed int v25; // [sp+10h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 signed int v26; // [sp+10h] [bp-10h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 signed int v27; // [sp+10h] [bp-10h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 char *Str; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 NPCGreeting *pGreetings; // [sp+14h] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 unsigned __int16 *pGroups; // [sp+14h] [bp-Ch]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 char **pCatchPhrase; // [sp+14h] [bp-Ch]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 signed int v32; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 signed int v33; // [sp+18h] [bp-8h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 signed int v34; // [sp+18h] [bp-8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 signed int v35; // [sp+18h] [bp-8h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 signed int v36; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 signed int v37; // [sp+1Ch] [bp-4h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 signed int v38; // [sp+1Ch] [bp-4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 signed int v39; // [sp+1Ch] [bp-4h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 v2 = (char *)pEvents_LOD->LoadRaw("npcdata.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 v1->pNPCDataTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 strtok(v2, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 v3 = (char *)&v1->pNPCData[1].house;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 Str = (char *)v1->pNPCNames2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 v24 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 v4 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 v36 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 v23 = (int)&v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 v32 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 switch ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 v7 = RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 *((int *)v3 - 5) = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 *(int *)Str = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 *((int *)v3 - 4) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 *(int *)v3 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 *((int *)v3 + 1) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 *((int *)v3 + 2) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 *((int *)v3 + 3) = *v4 == 121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 *((int *)v3 + 5) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 *((int *)v3 + 6) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 *((int *)v3 + 7) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 *((int *)v3 + 8) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 *((int *)v3 + 9) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 *((int *)v3 + 10) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 v4 = (char *)(v23 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 while ( v36 + 1 <= 15 && !v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 Str += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 --v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 while ( v24 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 v1->uNumNewNPCs = 501;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 v8 = (char *)pEvents_LOD->LoadRaw("npcgreet.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 v1->pNPCGreetTXT_Raw = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 strtok(v8, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 pGreetings = v1->pNPCGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 v25 = 205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 while ( v10 != 9 && v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 v12 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 v33 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 *(char *)v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 pGreetings->pGreeting1 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 pGreetings->pGreeting2 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 while ( v37 <= 2 && !v33 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 ++pGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 --v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 while ( v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 v13 = (char *)pEvents_LOD->LoadRaw("npcgroup.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 v1->pNCPGroupTXT_Raw = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 strtok(v13, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 pGroups = v1->pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 v14 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 while ( v15 != 9 && v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 v34 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 if ( v16 && v38 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 *pGroups = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 while ( v38 <= 1 && !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 ++pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 --v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 while ( v26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 v18 = (char *)pEvents_LOD->LoadRaw("npcnews.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 v1->pNPCNewsTXT_Raw = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 strtok(v18, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 pCatchPhrase = v1->pCatchPhrases;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 v27 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 v19 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 v20 = *v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 while ( v20 != 9 && v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 v20 = v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651 v22 = (int)&v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 if ( !v19[v21] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 *(char *)v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 if ( v21 && v39 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 *pCatchPhrase = (char *)RemoveQuotes(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 v19 = (char *)(v22 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 while ( v39 <= 1 && !v35 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 ++pCatchPhrase;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 --v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 while ( v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 //----- (0047702F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 void NPCStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5670 //NPCStats *v1; // edi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 char *v2; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5672 //char *v3; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 char *v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 char v5; // al@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 int v6; // ecx@4
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5676 //char *v7; // eax@18
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 char *v8; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 char *v9; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 char v10; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 char v12; // zf@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 signed int v13; // [sp+Ch] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 int v14; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 int v15; // [sp+10h] [bp-10h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 char *v16; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 signed int v17; // [sp+14h] [bp-Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 unsigned int v18; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 char *v19; // [sp+18h] [bp-8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 signed int v20; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 signed int v21; // [sp+1Ch] [bp-4h]@19
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5691 //v1 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 Initialize1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 Initialize2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 InitializeQuests();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 InitializeAutonotes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 InitializeAwards();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 InitializeTransitions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 InitializeMerchants();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 InitializeScrolls();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 v2 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5703 field_17FC0 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5704 pNPCNamesTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5705 //v3 = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5706 pNPCNamesTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5707 strtok(pNPCNamesTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 v18 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5709 v16 = (char *)pNPCNames;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 v4 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 if ( *v4 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 if ( v5 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 v14 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 *((int *)v16 + 1) = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 *(int *)v16 = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 LABEL_45:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5748 if ( v20 == 1 && !uNumNPCNames[1] )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5749 uNumNPCNames[1] = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 v4 += v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 while ( v20 <= 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 v16 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 if ( (signed int)v18 >= 540 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5761 pNPCProfTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5762 uNumNPCNames[0] = v18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5763 //v7 = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5764 pNPCProfTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5765 strtok(pNPCProfTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 strtok(0, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5769 v8 = (char *)&pProfessions[0].pJoinText;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5770 v19 = (char *)&pProfessions[0].pJoinText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 v13 = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 while ( v10 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 v8 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 v15 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 switch ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 *((int *)v8 - 3) = atoi(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 *((int *)v8 - 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 *((int *)v8 - 2) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 *(int *)v8 = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 *((int *)v8 + 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 v9 = (char *)(v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 while ( v21 <= 6 && !v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 v8 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 v12 = v13-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 v19 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 while ( !v12 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5832 uNumNPCProfessions = 59;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 //----- (00477266) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 void NPCStats::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 void *v2; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 pAllocator->FreeChunk(this->pNPCTopicTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 v2 = v1->pNPCTextTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 pAllocator->FreeChunk(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 pAllocator->FreeChunk(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 pAllocator->FreeChunk(v1->pNPCProfTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 v1->pNPCProfTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 pAllocator->FreeChunk(v1->pNPCNamesTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 v1->pNPCNamesTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 pAllocator->FreeChunk(v1->pNPCDataTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 v1->pNPCDataTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856 pAllocator->FreeChunk(v1->pNPCDistTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 v1->pNPCDistTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 v3 = (int)&v1->pNPCGreetTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 pAllocator->FreeChunk(v1->pNPCGreetTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 v1 = (NPCStats *)((char *)v1 + 98296);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861 *(int *)v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 pAllocator->FreeChunk(v1->pNPCData[0].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863 v1->pNPCData[0].pName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 //----- (0047730C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5867 int __fastcall const_1(int a1, int)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5873 //----- (0047732C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5874 bool NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5875 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5876 //NPCStats *v5; // ebx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 signed __int64 v6; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5878 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 int v8; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5880 NPCData *v9; // edi@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5881 int v10; // eax@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5882 //int v11; // eax@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5883 int v12; // ecx@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5884 int v13; // edx@28
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5885 int v14; // esi@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5886 int v15; // edx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5887 int v16; // ecx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5888 int v17; // eax@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5889 int v18; // edx@37
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5890 signed int result; // eax@39
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5891 int v20; // [sp+Ch] [bp-Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5892 signed int v21; // [sp+10h] [bp-8h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5893 signed int v22; // [sp+14h] [bp-4h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5894 int v23; // [sp+24h] [bp+Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5895
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5896
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5897 v23 = a3 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5898 //v5 = this;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5899 v6 = (signed __int64)((double)v23 * -0.33333334);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5900 v7 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 28];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5901 v20 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 116];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5902 v8 = rand() % uNumNPCNames[v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5903 v9 = a2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5904 a2->uSex = v7;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5905 a2->pName = pNPCNames[v8][v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5906 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5907 v22 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5908 v21 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5909
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5910 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5911 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5912 if ( v20 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5913 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5914 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5915 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5916 v23 = 2;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5917 a2 = (NPCData *)100;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5918 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5919 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5920 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5921 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5922 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5923 v23 = 201;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5924 a2 = (NPCData *)250;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5925 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5926 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5927 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5928 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5929 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5930 switch ( v20 - v10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5932 case 1:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5933 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5934 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5935 v23 = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5936 a2 = (NPCData *)430;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5938 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5939 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5940 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5941 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5942 v23 = 460;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5943 a2 = (NPCData *)490;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5944 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5946 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5947 case 2:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5948 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5949 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5950 v23 = 500;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5951 a2 = (NPCData *)520;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5953 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5954 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5955 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5956 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5957 v23 = 530;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5958 a2 = (NPCData *)550;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5959 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5961 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5962 case 3:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5963 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5964 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5965 v23 = 300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5966 a2 = (NPCData *)330;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5969 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5970 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5971 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5972 v23 = 360;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5973 a2 = (NPCData *)387;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5974 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5978 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5979 v12 = v23 + rand() % ((int)a2 - v23 + 1);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5980 if ( const_1(v12, v7) == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5981 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5982 ++v22;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5983 if ( v22 >= 4 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5984 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5985 v12 = v23;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5986 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5987 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5988 if ( v21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5989 break;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5990 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5991 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5992
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5993 v9->uPortraitID = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5994 v9->uFlags = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5995 v9->fame = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5996 v13 = rand() % 100 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5997
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5998 if ( v13 >= 60 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5999 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6000 if ( v13 >= 90 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6001 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6002 if ( v13 >= 95 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6003 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6004 if ( v13 >= 98 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6005 v9->rep = -600;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6006 else
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6007 v9->rep = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6008 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6009 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6010 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6011 v9->rep = -300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6012 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6013 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6014 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6015 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6016 v9->rep = 200;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6017 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6018 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6019 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6020 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6021 v9->rep = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6022 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6023
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6024 //v14 = (int)((char *)v5 + 64 * a5);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6025 //v15 = rand() % *(_DWORD *)(v14 + 91460);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6026 v15 = rand() % array_16544[a5].field_0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6027 v16 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6028 v17 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6029 v18 = v15 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6030
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6031 if ( v18 > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6032 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6033 do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6034 //v14 += *(char *)(v14 + v17++ + 0x16548);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6035 v16 += array_16544[a5].field_4[v17++];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6036 while ( v16 < v18 );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6037 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6038 v9->uProfession = v17 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6039 v9->house = a4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6040 v9->field_24 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6041 v9->joins = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6042 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 //----- (0047752B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 int __cdecl GetPartyReputation()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049 DDM_DLV_Header *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 signed int v1; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 v0 = &pOutdoor->ddm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 v0 = &pIndoor->dlv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 if ( CheckHiredNPCSpeciality(0x2Du) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 v1 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 if ( CheckHiredNPCSpeciality(0x33u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 if ( CheckHiredNPCSpeciality(0x30u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 if ( CheckHiredNPCSpeciality(0x32u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 if ( CheckHiredNPCSpeciality(0x34u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 return v1 + v0->uReputation;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 //----- (004775ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 if ( *(float *)(v4 - 15) <= (double)a2 && *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 if ( *(float *)v5 <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 if ( *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 //----- (00477927) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 int stru6_stru1_indoor_sw_billboard::_477927(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 if ( *(float *)(v4 - 15) >= (double)a2 && *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 if ( *(float *)v5 >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 if ( *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6307 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6308 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6309 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6310 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6311 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6318 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6320 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6321 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6322 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6323 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6324 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6325 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6326 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6327 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6328 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6329 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6330 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6331 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6332 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6333 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 //----- (00477C61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 int stru6_stru1_indoor_sw_billboard::sub_477C61()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 stru6_stru1_indoor_sw_billboard *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 int v2; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 double v5; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 double v6; // st6@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 double v7; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 float v8; // ST30_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 float v9; // ST24_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 double v10; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 double v11; // st6@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 double v12; // st5@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 float v13; // ST24_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 char *v15; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 signed int v16; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6386 __int16 v17; // fps@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6387 unsigned __int8 v18; // c2@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6388 unsigned __int8 v19; // c3@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6389 double v20; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6390 float v21; // ST18_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6391 float v22; // ST2C_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6392 float v23; // ST34_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6393 float v24; // ST24_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6394 double v25; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6395 double v26; // st6@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6396 float v27; // ST34_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6397 float v28; // ST30_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6398 int v29; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6399 signed int v31; // [sp+8h] [bp-28h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6400 float v32; // [sp+Ch] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6401 float v33; // [sp+14h] [bp-1Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6402 float v34; // [sp+18h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6403 float v35; // [sp+1Ch] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6404 float v36; // [sp+20h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6405 float v37; // [sp+24h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6406 float v38; // [sp+24h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6407 float v39; // [sp+28h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6408 float v40; // [sp+28h] [bp-8h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6409 float v41; // [sp+2Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6410 float v42; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6411
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6412 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6413 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6415 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6416 if ( v1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 v3 = (int)&v1->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6421 v4 = *(float *)(v3 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6422 LODWORD(v37) = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6423 LODWORD(v36) = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6424 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 v5 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6427 v6 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 v41 = pBLVRenderParams->fSineY * v6 + pBLVRenderParams->fCosineY * v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431 v7 = pBLVRenderParams->fSineY * v5 - pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 v41 = pBLVRenderParams->fCosineY * v5 - pBLVRenderParams->fSineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 v7 = pBLVRenderParams->fSineY * v5 + pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 v9 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 v10 = pBLVRenderParams->fCosineNegX * v41 - pBLVRenderParams->fSineNegX * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 v12 = pBLVRenderParams->fCosineNegX * v9 + pBLVRenderParams->fSineNegX * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6444 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 v42 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 v39 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 v10 = pBLVRenderParams->fSineY * v39 + pBLVRenderParams->fCosineY * v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 v11 = pBLVRenderParams->fSineY * v42 - pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 v10 = pBLVRenderParams->fCosineY * v42 - pBLVRenderParams->fSineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 v11 = pBLVRenderParams->fSineY * v42 + pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 v12 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 *(int *)(v3 + 84) = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 v14 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 *(float *)(v3 + 76) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6465 *(int *)(v3 + 88) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 *(float *)(v3 + 80) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 v3 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6469 while ( v2 < v1->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 v15 = (char *)&this->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 v31 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6476 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 v40 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 v32 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 v34 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationY) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 v16 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 LODWORD(v38) = *(int *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 v33 = (double)v16 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 //UNDEF(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 v20 = *((float *)v15 - 1) - (double)pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 if ( v19 | v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 v27 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 LODWORD(v35) = *((int *)v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 v28 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 v25 = v33 * v28 + v34 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6493 v26 = v34 * v28 - v33 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6495 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 v22 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499 v23 = v33 * v22 + v34 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 v24 = *((float *)v15 + 1) - (double)pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 v25 = v32 * v24 + v40 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 v26 = v34 * v22 - v33 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 v35 = v40 * v24 - v32 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 *((int *)v15 + 21) = LODWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 v29 = *((int *)v15 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 *((float *)v15 + 19) = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 *((int *)v15 + 22) = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 *((float *)v15 + 20) = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 v15 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 while ( v31 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 v1->field_10 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 //----- (00477F63) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 bool stru6_stru1_indoor_sw_billboard::sub_477F63()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 stru6_stru1_indoor_sw_billboard *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 char *v5; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 float v7; // ST08_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 signed int v9; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 float v10; // [sp+10h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 v10 = 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 v3 = (double)pBLVRenderParams->field_40 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 v10 = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 v3 = 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 v4 = a1->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 v5 = (char *)&a1->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 v6 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6554 if ( v3 >= *(float *)v5 || *(float *)v5 >= (double)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 if ( v3 < *(float *)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 v5 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6564 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6567 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 v2->_477927(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6570 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 memcpy(&v2->field_14[40], &v2->field_14[20], 16 * v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 _4775ED(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 //----- (0047802A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 int stru6_stru1_indoor_sw_billboard::sub_47802A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 stru6_stru1_indoor_sw_billboard *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 int v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 float v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 double v6; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 double v7; // ST30_8@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 double v8; // st6@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 double v9; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 char *v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 float v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6595 double v12; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 double v13; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6597 double v14; // st5@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6598 signed int v16; // [sp+38h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 int a6; // [sp+3Ch] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 int a5; // [sp+40h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 v4 = (char *)&a1->field_14[42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 LODWORD(v5) = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 v6 = (double)pBLVRenderParams->field_40 * 0.000015258789 / *((float *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 v7 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 pGame->pIndoorCameraD3D->Project(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 COERCE_UNSIGNED_INT64(v5 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 COERCE_UNSIGNED_INT64(*((float *)v4 - 1) + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 COERCE_UNSIGNED_INT64(*(float *)v4 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 &a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 *((float *)v4 + 18) = (double)a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 *((float *)v4 + 19) = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 *((float *)v4 + 20) = (double)SLODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 *((float *)v4 + 18) = (double)pBLVRenderParams->uViewportCenterX - v6 * *((float *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 v8 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 v9 = v6 * *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 *((int *)v4 + 20) = LODWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 *((float *)v4 + 19) = v8 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 *((int *)v4 + 21) = *((int *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 && (double)(signed int)pViewport->uViewportZ > *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 && (double)(signed int)pViewport->uViewportY <= *((float *)v4 + 19)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 && (double)(signed int)pViewport->uViewportW > *((float *)v4 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6647 while ( v3 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654 v10 = (char *)&a1->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6655 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 LODWORD(v11) = *(int *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 v12 = (double)pOutdoorCamera->int_fov_rad / *(float *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 *((float *)v10 + 20) = (double)pViewport->uScreenCenterX - v12 * *((float *)v10 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 v13 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661 v14 = v12 * *((float *)v10 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 *((int *)v10 + 22) = LODWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 *((int *)v10 + 23) = *((int *)v10 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 *((float *)v10 + 21) = v13 - v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6665 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 && (double)(signed int)pViewport->uViewportZ > *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667 && (double)(signed int)pViewport->uViewportY <= *((float *)v10 + 21)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6668 && (double)(signed int)pViewport->uViewportW > *((float *)v10 + 21) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6671 v10 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 while ( v1 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 return v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 //----- (004783FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 void __cdecl sub_4783FA_construct_global_73D150()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 char *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 v0 = (char *)&array_73D150[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 v1 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 *(float *)v0 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 v0 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 --v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695 while ( v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6699
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 //----- (0047840D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 char Render::DrawBuildingsD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 IndoorCameraD3D *v0; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 Vec3_int_ **v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 Vec3_int_ *v3; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 ODMFace *pFace; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 int v5; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 stru148 *v7; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 LightmapBuilder *v8; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 int v9; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 char v10; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 Texture *pFaceTexture; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 signed int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 unsigned int v13; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 unsigned int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 unsigned int v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 unsigned int v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 int v17; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 int v18; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 char *v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 char *v20; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 Vec3_int_ *v21; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 int v22; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 char *v23; // edi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 int v24; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 int v25; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 int v26; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 int v28; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 double v30; // st7@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 LightmapBuilder *v31; // edi@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 signed int v32; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 int v33; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 unsigned int v34; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 std::string v35; // [sp-18h] [bp-70h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 int v36; // [sp-14h] [bp-6Ch]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 RenderVertexSoft *v37; // [sp-10h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 int v38; // [sp-Ch] [bp-64h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 LightmapBuilder *v39; // [sp-8h] [bp-60h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 int v40; // [sp-4h] [bp-5Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 std::string *v41; // [sp+Ch] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 Vec3_int_ *v42; // [sp+10h] [bp-48h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 LightmapBuilder *pLightmapBuilder; // [sp+14h] [bp-44h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 float v44; // [sp+18h] [bp-40h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6748 float v45; // [sp+1Ch] [bp-3Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 ODMFace *v46; // [sp+20h] [bp-38h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 IndoorCameraD3D *v47; // [sp+24h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6751 unsigned int v48; // [sp+28h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 int v49; // [sp+2Ch] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 int v50; // [sp+30h] [bp-28h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 int v51; // [sp+34h] [bp-24h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 int v52; // [sp+38h] [bp-20h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 int v53; // [sp+3Ch] [bp-1Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 Vec3_int_ *v54; // [sp+40h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 int a1; // [sp+44h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6759 Vec3_int_ **v56; // [sp+48h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 int uNumVertices; // [sp+4Ch] [bp-Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 int unused; // [sp+50h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 int a3; // [sp+57h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 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
6767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768 unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 v0 = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 v47 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 result = LOBYTE(pOutdoor->pBModels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 v41 = (std::string *)pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6776 v2 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 v56 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 if ( IsBModelVisible(a1, &unused) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 *(v2 - 3) = (Vec3_int_ *)((unsigned int)*(v2 - 3) | 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 pFace = (ODMFace *)v2[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 v42 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 if ( (signed int)v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 v2 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 v56 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 if ( a1 >= (signed int)v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 if ( pFace->uFaceAttributes & 0x2000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6803 v5 = (int)*(v2 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 v6 = pFace->pVertexIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 v7 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 v8 = *(LightmapBuilder **)(v5 + 12 * v6 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 *(int *)&v7->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 pLightmapBuilder = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 v9 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 v10 = (BYTE1(pFace->uFaceAttributes) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 v48 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 v48 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 v9 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 pFaceTexture = (Texture *)(v9 != -1 ? (int)&pBitmaps_LOD->pTextures[v9] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 v7->pTexture = pFaceTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 v49 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 v49 = pFaceTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 v10 = (pFace->uFaceAttributes & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 v45 = 1.0 / (double)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 v44 = 1.0 / (double)v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 *(int *)&v7->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 if ( BYTE2(pFace->uFaceAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 v13 = pFace->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 if ( v13 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 if ( v13 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 HIBYTE(v7->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 v14 = pFace->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 if ( BYTE1(v14) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 *(int *)&v7->flags |= 0x2000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 if ( v14 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 HIBYTE(v7->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6850 v15 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 v7->sTextureDeltaU = pFace->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 v7->sTextureDeltaV = pFace->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6853 v16 = v15 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 if ( pFace->pFacePlane.vNormal.z && (v40 = pFace->pFacePlane.vNormal.z, abs(v40) >= 59082) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6861 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 v7->sTextureDeltaV -= v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6871 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6874 v7->sTextureDeltaV += v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6878 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6879 if ( BYTE1(v17) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 v7->sTextureDeltaU -= v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6885 if ( BYTE1(v17) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 v7->sTextureDeltaU += v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6888 v18 = pFace->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 v19 = (char *)&array_73D150[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 v20 = (char *)pFace->pTextureUIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 v51 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 v21 = &(*(v56 - 1))[*((short *)v20 - 20)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6900 *((float *)v19 - 2) = (double)v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 *((float *)v19 - 1) = (double)v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 *(float *)v19 = (double)v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 v19 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 v52 = v7->sTextureDeltaU + *(short *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 *((float *)v19 - 5) = (double)v52 * v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 v22 = v7->sTextureDeltaV + *((short *)v20 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 v20 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 v10 = v51-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6909 v52 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 *((float *)v19 - 4) = (double)v22 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6911 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6912 while ( !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 v23 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 v51 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6915 *(float *)&pLightmapBuilder = (double)(signed int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 if ( *(float *)&pLightmapBuilder == *((float *)v23 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 v47->ViewTransform((RenderVertexSoft *)(v23 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 if ( *(float *)v23 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 if ( *(float *)v23 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 v47->_436BB7_project_and_stuff((RenderVertexSoft *)(v23 - 12), 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 v23 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933 --v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 while ( v51 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 v18 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 if ( v53 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 LOBYTE(v7->field_32) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 v24 = pOutdoor->vSunlight.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 v7->pODMFace = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 v7->uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 v7->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 pLightmapBuilder = (LightmapBuilder *)-v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 v51 = pFace->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 v51 = (unsigned __int64)(-v24 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 v53 = pFace->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 pLightmapBuilder = (LightmapBuilder *)-pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 v53 = (unsigned __int64)(-pOutdoor->vSunlight.y * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 v52 = pFace->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 v52 = (unsigned __int64)(-pOutdoor->vSunlight.z * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 pLightmapBuilder = (LightmapBuilder *)(v51 + v53 + v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 v51 = 20 * (int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 result = 20 - (20 * (signed int)pLightmapBuilder >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 v7->field_58 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 if ( result < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 v7->field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 if ( v7->field_58 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 v7->field_58 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 if ( pOutdoorCamera->numStru148s >= 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 if ( ODMFace::IsBackfaceCulled(pFace, array_73D150, v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 LOBYTE(v25) = (char)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 pFace->bVisible = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 v7->uBModelFaceID = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 LOWORD(v25) = (unsigned __int8)v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 v7->uBModelID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 v27 = 8 * (v25 | (v26 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6973 LOBYTE(v27) = v27 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 v7->field_50 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 v29 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 v30 = 1.0 / (array_73D150[v28].vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982 memcpy(&array_50AC10[v28], &array_73D150[v28], sizeof(array_50AC10[v28]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 --v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 array_50A2B0[v28 + 49].flt_20 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 while ( v29 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 pFace = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6990
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 static stru154 static_RenderBuildingsD3D_stru_73C834;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 static_RenderBuildingsD3D_byte_73C84C_init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 stru154::stru154(&static_RenderBuildingsD3D_stru_73C834);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 atexit(loc_4789D4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 v40 = (int)pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 pLightmapBuilder = pGame->pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 v31 = pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 pLightmapBuilder->ApplyLights_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 pDecalBuilder->ApplyDecals_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 v31->std__vector_000004_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 LOBYTE(v31) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 if ( stru_F8AD28.field_AC > 0 || pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7012 static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 if ( pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 v40 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 v39 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7017 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 v37 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 v36 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 pDecalBuilder->ApplyDecals(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 31 - v7->field_58,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 array_50AC10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 (char)v31,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 if ( stru_F8AD28.field_AC > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 pLightmapBuilder->ApplyLights(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 &stru_F8AD28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 array_50AC10,
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
7037 0,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 (char)v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 v32 = sr_424CD7(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 v32 = sr_424EE0_MakeFanFromTriangle(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 v7->uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 OutdoorCamera::Project(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 if ( uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 v33 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 if ( v33 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 if ( BYTE1(v33) & 0x3C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 v34 = pRenderer->pHDWaterBitmapIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 v34 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061 v40 = (int)pBitmaps_LOD->pHardwareTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 v40 = (int)pBitmaps_LOD->pHardwareTextures[v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 pRenderer->DrawPolygon(uNumVertices, v7, pFace, (IDirect3DTexture2 *)v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 v54 = (Vec3_int_ *)((char *)v54 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 v2 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 ++pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7077 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 if ( (signed int)v54 >= (signed int)v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 // 73C84C: using guessed type char static_RenderBuildingsD3D_byte_73C84C_init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7086 //----- (004789DE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 BSPModel *Render::DrawBuildingsSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 BSPModel *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 unsigned int *v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 int v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 double v8; // st7@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 char *v9; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 double v11; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 stru148 *v12; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 double v13; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 double v14; // ST4C_8@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 int v16; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 int v17; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 unsigned __int8 v18; // sf@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 unsigned __int8 v19; // of@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 int v21; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 int v22; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 int v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 int v24; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 Texture *v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 int v26; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 signed int v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 double v28; // st6@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 double v29; // st5@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 int v30; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 int v31; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 double v32; // st4@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 int v33; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 char v34; // zf@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 BSPVertexBuffer *v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 unsigned int v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 signed int v37; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 int v38; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 signed int v39; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 char *v40; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 double v41; // ST1C_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 double v42; // ST24_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 signed int v43; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 signed int v44; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 int v45; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 signed int v46; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 char *v47; // ecx@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 double v48; // ST34_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 double v49; // ST44_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 int v50; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 signed int v51; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 char *v52; // edx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 double v53; // ST3C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 double v54; // ST2C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 float v55; // [sp+44h] [bp-7Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 float v56; // [sp+48h] [bp-78h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 float v57; // [sp+4Ch] [bp-74h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 float v58; // [sp+50h] [bp-70h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 int v59; // [sp+54h] [bp-6Ch]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 int v60; // [sp+58h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 float v61; // [sp+5Ch] [bp-64h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 float v62; // [sp+60h] [bp-60h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 float v63; // [sp+64h] [bp-5Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 float v64; // [sp+68h] [bp-58h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 int v65; // [sp+6Ch] [bp-54h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 int v66; // [sp+70h] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 int v67; // [sp+74h] [bp-4Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 int v68; // [sp+78h] [bp-48h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 int v69; // [sp+7Ch] [bp-44h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 int v70; // [sp+80h] [bp-40h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7160 int v71; // [sp+84h] [bp-3Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 float v72; // [sp+88h] [bp-38h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 int v73; // [sp+8Ch] [bp-34h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 int v74; // [sp+90h] [bp-30h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 int v75; // [sp+94h] [bp-2Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 int v76; // [sp+98h] [bp-28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 int v77; // [sp+9Ch] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 unsigned int *v78; // [sp+A0h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 int v79; // [sp+A4h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 int a1; // [sp+A8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7170 int v81; // [sp+ACh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 int v82; // [sp+B0h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 int v83; // [sp+B4h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7173 signed int v84; // [sp+B8h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 int a2; // [sp+BCh] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 result = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 v66 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 v1 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183 v78 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 if ( IsBModelVisible(a1, &a2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 *(v1 - 3) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7190 v3 = v1[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v79 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 v68 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 v1 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 result = (BSPModel *)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 v78 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 if ( a1 >= v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 if ( !(*(char *)(v3 + 29) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 v4 = 3 * *(short *)(v3 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 v5 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 v67 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 v6 = *(int *)(*(v1 - 1) + 4 * v4 + 8) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 v83 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 v7 = *(char *)(v3 + 302);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 v77 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 v8 = (double)v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 v9 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 v81 = v3 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 *(float *)&v84 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 v10 = *(int *)(v5 + 4) + 12 * *(short *)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 *((float *)v9 - 3) = (double)*(signed int *)v10 + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 *((float *)v9 - 2) = (double)*(signed int *)(v10 + 4) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 v11 = (double)*(signed int *)(v10 + 8) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 *((float *)v9 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 if ( *(float *)&v84 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 pGame->pIndoorCameraD3D->ViewTransform((RenderVertexSoft *)(v9 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 if ( *(float *)v9 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 if ( *(float *)v9 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 v74 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 pGame->pIndoorCameraD3D->_436BB7_project_and_stuff((RenderVertexSoft *)(v9 - 12), 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 v81 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 v9 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 --v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 v5 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 v7 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 v12 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 *(int *)&v12->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 if ( v82 == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 *(int *)&v12->flags = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 v12->pODMFace = (ODMFace *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7261 v12->uNumVertices = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 v12->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 v84 = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7264 v83 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 v82 = -pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 v84 = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 v82 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 v81 = -pOutdoor->vSunlight.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 v84 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 v81 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 v84 = v83 + v82 + ((unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7272 v13 = (double)v84 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 if ( v13 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 v13 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 *(float *)&v84 = v13 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 v14 = *(float *)&v84 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 v71 = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 v15 = (int)&v12->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 v12->field_58 = 31 - LOBYTE(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7280 if ( (char)(31 - LOBYTE(v14)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 if ( *(char *)v15 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 *(char *)v15 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 v16 = *(short *)(v3 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 if ( *(char *)(v3 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 v16 = pTextureFrameTable->GetFrameTexture(v16, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 v17 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288 result = (BSPModel *)&pBitmaps_LOD->pTextures[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7289 v19 = __OFSUB__(pOutdoorCamera->numStru148s, 1999);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 v18 = pOutdoorCamera->numStru148s - 1999 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 if ( !(v18 ^ v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 if ( !ODMFace::IsBackfaceCulled((ODMFace *)v3, array_73D150, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 LOBYTE(v20) = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 *(char *)(v3 + 305) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 v12->uBModelFaceID = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 LOWORD(v20) = (unsigned __int8)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 v12->uBModelID = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 v22 = 8 * (v20 | (v21 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 v12->field_50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 if ( *(char *)(v3 + 28) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 *(int *)&v12->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 if ( *(char *)(v3 + 30) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 v23 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 if ( v23 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 if ( v23 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 HIBYTE(v12->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 v24 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 if ( BYTE1(v24) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 HIBYTE(v12->flags) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 if ( v24 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 HIBYTE(v12->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 v25 = v12->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v27 = v25->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 v84 = v25->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 v28 = 1.0 / (double)v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 v29 = 1.0 / (double)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 if ( v77 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 v30 = v3 + 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346 v83 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 v32 = 1.0 / (*(float *)(v31 * 48 + 7590236) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350 memcpy(&array_50AC10[v31], &array_73D150[v31], sizeof(array_50AC10[v31]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352 array_50A2B0[v31 + 49].flt_20 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 v84 = v12->sTextureDeltaU + *(short *)(v30 - 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 array_50A2B0[v31 + 49].u = (double)v84 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 v33 = v12->sTextureDeltaV + *(short *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356 v30 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 v34 = v83-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 v84 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 array_50A2B0[v31 + 49].v = (double)v33 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 while ( !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 v3 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7363 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366 static stru154 static_sub_004789DE_stru_73C818; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 static_sub_004789DE_byte_73C830__init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 stru154::stru154(&static_sub_004789DE_stru_73C818);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 if ( stru_F8AD28.field_AC <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 v12->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 v35 = (BSPVertexBuffer *)(v78 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 v12->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 v55 = static_sub_004789DE_stru_73C818.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 v56 = static_sub_004789DE_stru_73C818.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 v57 = static_sub_004789DE_stru_73C818.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 v36 = sr_4250FE(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 v37 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 if ( !v36 || (OutdoorCamera::Project(v36), v38 = sr_4254D2(v37), (v12->uNumVertices = v38) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 v40 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 LODWORD(v64) = *((int *)v40 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 v41 = v64 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 v69 = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 dword_50B638[v39] = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 LODWORD(v63) = *(int *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 v42 = v63 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 v73 = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 v40 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 dword_50B570[v39++] = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 while ( v39 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 if ( v75 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 v43 = sr_4252E8(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 v44 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 if ( !v43 || (OutdoorCamera::Project(v43), v45 = sr_4254D2(v44), (v12->uNumVertices = v45) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 v47 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 LODWORD(v61) = *((int *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 v48 = v61 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 v65 = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 dword_50B638[v46] = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 LODWORD(v58) = *(int *)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 v49 = v58 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 v59 = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 v47 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 dword_50B570[v46++] = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 while ( v46 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 v50 = sr_4254D2(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 v12->uNumVertices = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 sr_sub_4829B9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 &array_73D150[*(char *)(v3 + 298)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 &array_73D150[*(char *)(v3 + 299)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 &array_73D150[*(char *)(v3 + 300)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 v52 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 LODWORD(v62) = *((int *)v52 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 v53 = v62 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 v60 = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 dword_50B638[v51] = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 LODWORD(v72) = *(int *)v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 v54 = v72 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 v70 = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 v52 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 dword_50B570[v51++] = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 while ( v51 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638, dword_50B570, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 v1 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 v3 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 if ( v79 >= v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 // 73C830: using guessed type char static_sub_004789DE_byte_73C830__init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 //----- (00479089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 BSPModel *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 int v5; // ST28_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 int v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 int v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 signed int v11; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 int v12; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 bool result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 unsigned int v14; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 int v15; // [sp+Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 int *v16; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 int v17; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 int v18; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 int v19; // [sp+20h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 int angle; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 int v21; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 int v22; // [sp+28h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 v16 = unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 angle = (signed int)(pOutdoorCamera->uCameraFovInDegrees << 11) / 360 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 v14 = uModelID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 v2 = &pOutdoor->pBModels[uModelID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 v3 = v2->vBoundingCenter.x - pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 v4 = v2->vBoundingCenter.y - pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 v5 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 v21 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 v18 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 v17 = v3 * v5 + v4 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 v17 = (unsigned __int64)(v17 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 v19 = v4 * v6 - v3 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 v7 = abs(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 v8 = abs(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 v9 = sub_4621DA(v8, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 v10 = v14 * 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 v22 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 *v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 if ( v9 < pOutdoor->pBModels[v14].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 *v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 v15 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 v11 = ((unsigned __int64)(v15 * (signed __int64)v17) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 - ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 + ((unsigned __int64)(v15 * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 v12 = v11 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551 if ( v22 <= pOutdoorCamera->shading_dist_mist + 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553 if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v10) + 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555 result = v12 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 LOBYTE(result) = v12 >= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 //----- (00479295) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574 int stru148::_479295()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576 stru148 *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 ODMFace *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 int v6; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 int v7; // ST04_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 stru149 *v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 Vec3_int_ thisa; // [sp+Ch] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 int v11; // [sp+18h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 v2 = this->pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 if ( !v2->pFacePlane.vNormal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 v3 = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 v4 = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 v11 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 if ( (v2->pFacePlane.vNormal.x || v2->pFacePlane.vNormal.y) && abs(v2->pFacePlane.vNormal.z) < 59082 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 thisa.x = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 thisa.y = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 thisa.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 thisa.Normalize_float();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 v4 = thisa.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 v3 = thisa.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 v4 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 v5 = -65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 v6 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 v1->sTextureDeltaU = v2->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 v8 = v1->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 v1->sTextureDeltaV = v2->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 v8->_48616B(v4, v7, 0, 0, v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 //----- (00479332) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 int Render::OnOutdoorRedrawSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 char v3; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 float v5; // ST34_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 double v6; // ST24_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 unsigned int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 signed int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 Vec3_float_ *v10; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 double v11; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 float v12; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 double v13; // ST1C_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 float v14; // [sp+4h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 float v15; // [sp+8h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 float v16; // [sp+Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 v14 = (double)pOutdoor->vSunlight.x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 v1 = (unsigned int)&array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 v15 = (double)pOutdoor->vSunlight.y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 v16 = (double)pOutdoor->vSunlight.z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 if ( v1 > (unsigned int)array_77EC08 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 v2 = (char *)&array_77EC08[0].pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 v3 = v2[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 if ( v3 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 v9 = pTerrainNormalIndices[((*((int *)v2 - 9) >> 15) & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 + 2 * ((unsigned __int8)v2[9] + ((unsigned __int8)v2[8] << 7))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 if ( v9 > (signed int)(uNumTerrainNormals - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 v10 = &pTerrainNormals[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 v11 = -(v16 * v10->z + v15 * v10->y + v14 * v10->x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 if ( v11 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 v11 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 v12 = v11 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 v13 = v12 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 v2[4] = 31 - LOBYTE(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 if ( v2[4] < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 v2 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 if ( (unsigned int)(v2 - 84) >= v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 v4 = (double)(signed int)(((unsigned __int64)(**(int **)v2 * (signed __int64)-pOutdoor->vSunlight.x) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 + ((unsigned __int64)(*(int *)(*(int *)v2 + 4) * (signed __int64)-pOutdoor->vSunlight.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 + ((unsigned __int64)(*(int *)(*(int *)v2 + 8) * (signed __int64)-pOutdoor->vSunlight.z) >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 if ( v4 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 v4 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 v5 = v4 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 v6 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 v7 = (int)(v2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 v2[4] = 31 - LOBYTE(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 if ( (char)(31 - LOBYTE(v6)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 if ( *(char *)v7 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 *(char *)v7 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 if ( *(char *)(*(int *)v2 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 v8 = pTextureFrameTable->GetFrameTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 *((short *)v2 - 4),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 *((int *)v2 - 6) = v8 != -1 ? (int)&pBitmaps_LOD->pTextures[v8] : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 //----- (00479543) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 void Render::DrawSkyD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 double v2; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 double v3; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 double v4; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 double v5; // st4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 double v6; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 char *v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 int v8; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 int v10; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 signed __int64 v11; // qax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 double v12; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 int v13; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 int v14; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 int v15; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 int v16; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 signed __int64 v17; // qtt@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 signed int v18; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 Texture *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 double v20; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 double v21; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 double v22; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 unsigned __int8 v23; // sf@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 unsigned __int8 v24; // of@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 stru148 _this; // [sp+14h] [bp-150h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 double v26; // [sp+120h] [bp-44h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 float v27; // [sp+128h] [bp-3Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 float v28; // [sp+12Ch] [bp-38h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 int v29; // [sp+130h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 int v30; // [sp+134h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 int v31; // [sp+138h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 int v32; // [sp+13Ch] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 int v33; // [sp+140h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 float v34; // [sp+144h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 int v35; // [sp+148h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 double v36; // [sp+14Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 int v37; // [sp+154h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 int v38; // [sp+158h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 int v39; // [sp+15Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 int v40; // [sp+160h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 v30 = (signed __int64)((double)(pOutdoorCamera->int_fov_rad * pIndoorCamera->pos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 / ((double)pOutdoorCamera->int_fov_rad + 8192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 + (double)pViewport->uScreenCenterY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 v34 = cos((double)pIndoorCamera->sRotationX * 0.0030664064) * (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 v38 = (signed __int64)((double)pViewport->uScreenCenterY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 - (double)pOutdoorCamera->int_fov_rad
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 / (v34 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 * (sin((double)pIndoorCamera->sRotationX * 0.0030664064)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 * (double)-pOutdoorCamera->shading_dist_mist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 - (double)pIndoorCamera->pos.z));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 _this._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 _this.ptr_38->_48694B();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771 _this.uTileBitmapID = LOWORD(pOutdoor->uSky_TextureID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 _this.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 if ( _this.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 v0 = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 _this.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 _this.uNumVertices = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 _this.v_18.x = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 _this.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 v1 = stru_5C6E00->SinCos(v0 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 v2 = (double)(signed int)pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 _this.v_18.z = -v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 array_50AC10[0].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 v3 = (double)(signed int)pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 array_50AC10[0].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 array_50AC10[1].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 v4 = (double)v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 _this.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 _this.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 v28 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 array_50AC10[1].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 v5 = (double)(signed int)pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 array_50AC10[2].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 v38 = pViewport->uViewportZ - pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 _this.field_24 = 0x2000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 array_50AC10[2].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 array_50AC10[3].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 array_50AC10[3].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 v6 = tan(0.6457717418670654);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 v33 = 65536 / (signed int)(signed __int64)(v36 / v6 + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 if ( (signed int)_this.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 v7 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 LODWORD(v27) = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 v26 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 v29 = LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 v38 = _this.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 v8 = v39 + _this.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 v39 = v33 * (v30 - LODWORD(v26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 v38 = _this.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 HIDWORD(v36) = v39 + _this.ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 v38 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 v9 = (unsigned __int64)(_this.v_18.z * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 v10 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 v39 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 if ( _this.v_18.x + v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 v11 = (signed __int64)*((float *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 v38 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 v12 = *(float *)v7 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 v13 = v33 * (pViewport->uScreenCenterX - v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 LODWORD(v34) = -_this.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 v32 = (signed __int64)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 v14 = v33 * (v30 - v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 v40 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 v37 = abs(SLODWORD(v34) >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 v15 = abs(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 if ( v37 <= v15 || v32 <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 if ( v39 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 v14 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 v37 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 v14 += v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 v10 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 v39 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 v38 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 LODWORD(v17) = LODWORD(v34) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 HIDWORD(v17) = SLODWORD(v34) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 v40 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 v18 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 if ( v18 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 v18 = pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 v37 = _this.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 v37 = v35 + ((unsigned __int64)(v37 * (signed __int64)v13) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 v35 = _this.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 HIDWORD(v36) += (unsigned __int64)(v35 * (signed __int64)v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 + ((signed int)((unsigned __int64)(v37 * (signed __int64)v18) >> 16) >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 v40 = (unsigned __int64)(SHIDWORD(v36) * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 v19 = _this.pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 HIDWORD(v36) = _this.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 v20 = (double)SHIDWORD(v36) * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 HIDWORD(v36) = 224 * pMiscTimer->uTotalGameTimeElapsed + (v40 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878 *((float *)v7 - 10) = (double)v35 / v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 v21 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 HIDWORD(v36) = v19->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 v22 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 HIDWORD(v36) = v18 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 v24 = __OFSUB__(v31, _this.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 v23 = ((v31 - _this.uNumVertices) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 *((float *)v7 - 9) = v21 / (v22 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 *((float *)v7 - 16) = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 *((float *)v7 - 11) = 1.0 / (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 if ( !(v23 ^ v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 array_50AC10[0].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896 array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 array_50AC10[3].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 //----- (00479A53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 void __fastcall sub_479A53(unsigned int uNumVertices, unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 BLVFace *pFace; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 PolygonType v4; // al@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 signed __int64 v6; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 PolygonType v7; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 int v8; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 int v9; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 unsigned int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 double v11; // st6@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 int v12; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 char *v14; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 void *v15; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 int v16; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 int v17; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 double v18; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 signed int v19; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 void *v20; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 int v21; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 int v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 signed __int64 v23; // qtt@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 double v24; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 unsigned __int8 v25; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 unsigned __int8 v26; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 Render *v27; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 double v28; // st7@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 char *v29; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 char *v30; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 unsigned __int8 v31; // c0@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 unsigned __int8 v32; // c3@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 double v33; // st6@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 char *v34; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 const void *v35; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 int v36; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 const void *v37; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 signed __int64 v38; // qax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 int v39; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 int v40; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 int v41; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 signed __int64 v42; // qtt@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 int v43; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 char v44; // zf@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 double v45; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 double v46; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 unsigned int v47; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 double v48; // st7@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 RenderVertexSoft *v49; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 void *v50; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 double v51; // st7@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 RenderVertexSoft *v52; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 void *v53; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 char *v54; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 unsigned int v55; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 unsigned int v56; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 int v57; // ST10_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 Texture *v58; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 signed int v59; // [sp-4h] [bp-178h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 stru148 *v60; // [sp+0h] [bp-174h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 stru148 v62; // [sp+14h] [bp-160h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 unsigned int v63; // [sp+120h] [bp-54h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 double v64; // [sp+124h] [bp-50h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 unsigned int v65; // [sp+128h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 unsigned int v66; // [sp+12Ch] [bp-48h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 float v67; // [sp+130h] [bp-44h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 __int64 v68; // [sp+134h] [bp-40h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 __int64 v69; // [sp+13Ch] [bp-38h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 int v70; // [sp+144h] [bp-30h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 int X; // [sp+148h] [bp-2Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 int v72; // [sp+14Ch] [bp-28h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 float v73; // [sp+150h] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 unsigned int v74; // [sp+154h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 RenderVertexSoft *v75; // [sp+158h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 float v76; // [sp+15Ch] [bp-18h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 int v77; // [sp+160h] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 int v78; // [sp+164h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 void *v79; // [sp+168h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 float v80; // [sp+16Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 const void *v81; // [sp+170h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 pFace = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 v65 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 v3 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 v4 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 v54 = (char *)&array_507D30[0].u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 LODWORD(v80) = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 v69 = (GetTickCount() >> 5) - pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 *(float *)v54 = (double)v69 + *(float *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 *(float *)v54 = *(float *)v54 * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 v55 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 v54 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 v44 = LODWORD(v80)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 v68 = pBLVRenderParams->vPartyPos.y + (v55 >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 *((float *)v54 - 11) = ((double)v68 + *((float *)v54 - 11)) * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 uFaceID = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 v56 = 8 * uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 LOBYTE(v56) = 8 * uFaceID | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 v57 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 v58 = pFace->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 pRenderer->DrawIndoorPolygon(v3, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], v58, v57, -1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 HIDWORD(v69) = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 HIDWORD(v68) = pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 v70 = (signed __int64)((double)(pBLVRenderParams->field_40 * pBLVRenderParams->vPartyPos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 / (((double)pBLVRenderParams->field_40 + 16192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 * 65536.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 + *(float *)&v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 v5 = (double)pIndoorCamera->sRotationX * 0.0030664064;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 *(float *)&v75 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 v80 = cos(v5) * 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 v6 = (signed __int64)(*(float *)&v74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 - (double)pBLVRenderParams->field_40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 / ((v80 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 * 65535.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 * (sin(*(float *)&v75) * -16192.0 - (double)SHIDWORD(v68)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 v7 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 if ( v7 == 4 || v7 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 v70 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 v62._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 v62.uTileBitmapID = pFace->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 if ( !v62.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 v8 = pBLVRenderParams->sPartyRotX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 v62.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 v62.uNumVertices = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 v62.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 v62.v_18.x = -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 v62.v_18.z = -stru_5C6E00->SinCos(v8 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 LODWORD(v80) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 v62.field_24 = 33554432;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 v64 = (double)(signed int)v10 * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 LODWORD(v80) = v62.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 v11 = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 LODWORD(v80) = v62.pTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 v12 = v62.pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 v13 = v62.pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 v67 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 *((float *)&v68 + 1) = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 if ( (signed int)v62.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 v59 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 v14 = (char *)&array_507D30[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 v15 = (void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v14));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 LODWORD(v80) = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 v16 = v77 + v62.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 v77 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 v74 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 LODWORD(v80) = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 v79 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 v17 = v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v14 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 v18 = *(float *)v14 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 v19 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 v77 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 X = (int)((char *)v79 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 LODWORD(v76) = (signed __int64)v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 v20 = (void *)(v72 * (v70 - LODWORD(v76)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 v79 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 v21 = abs(v19 >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 if ( v21 <= abs(X) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 v19 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 v20 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 v20 = (char *)v20 + v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 X = v22 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 LODWORD(v23) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 HIDWORD(v23) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 v79 = (void *)(v23 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 LODWORD(v80) = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 LODWORD(v76) = v74 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 LODWORD(v80) = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 v14 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 v81 = (char *)v81 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 v24 = (double)SLODWORD(v80) * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 v26 = __OFSUB__((int)v81, v62.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 *((float *)v14 - 10) = v24 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 *((float *)v14 - 9) = (double)SLODWORD(v80) * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 *((float *)v14 - 11) = 65536.0 / (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 if ( !(v25 ^ v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 LODWORD(v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 v80 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 if ( (signed int)v62.uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 v28 = (double)SLODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 LODWORD(v76) = (int)(char *)array_50AC10 + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 v29 = (char *)&array_50AC10[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 v30 = (char *)&array_507D30[1].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 v79 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 v81 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 v78 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 v31 = v28 < *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 v32 = v28 == *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 memcpy(v79, v81, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 if ( v31 | v32 || v28 >= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 if ( v28 >= *((float *)v30 - 12) || v28 <= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 v33 = (*((float *)v30 - 1) - *((float *)v30 - 13)) * v28 / (*(float *)v30 - *((float *)v30 - 12))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 + *((float *)v30 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 v33 = (*((float *)v30 - 13) - *((float *)v30 - 1)) * v28 / (*((float *)v30 - 12) - *(float *)v30)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 + *((float *)v30 - 13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 *(float *)v29 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 *(unsigned int *)LODWORD(v76) = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 v81 = (char *)v81 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 v30 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 if ( SLODWORD(v73) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 v34 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 v65 = v77 >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 v78 = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 v36 = (int)((char *)v81 + v62.ptr_38->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 v81 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 v74 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 v78 = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 v78 = (int)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 v81 = (const void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 v37 = (const void *)(v72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 v38 = (signed __int64)(*(float *)v34 - 1.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 LODWORD(v76) = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 v39 = v72 * (v70 - v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 v78 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 v40 = abs(X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 if ( abs((signed __int64)v65) <= v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 v39 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 v78 = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 v39 += v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 X = v41 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 v81 = (const void *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 if ( v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 v79 = (void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 v78 = 2 * LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 v81 = (const void *)((unsigned __int64)(v62.v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 * (signed __int64)(signed int)(signed __int64)(((double)v70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 - ((double)(2 * LODWORD(v76))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 - *(float *)v34))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 * (double)v72)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 X = (int)((char *)v81 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 LODWORD(v42) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 HIDWORD(v42) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 v79 = (void *)(v42 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 v81 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 v78 = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 v74 = (unsigned int)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 LODWORD(v76) = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 v78 = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 v74 = (unsigned __int64)(v43 * v42 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 v34 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 v78 = v66 + ((signed int)v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 v44 = HIDWORD(v69)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 v45 = (double)v78 * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 v78 = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v42 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 *((float *)v34 - 10) = v45 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 *((float *)v34 - 9) = (double)v78 * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 v46 = (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 *((float *)v34 - 16) = 0.000015258789 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 *((float *)v34 - 11) = 65536.0 / v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 v47 = 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 v48 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 v49 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 HIDWORD(v69) = LODWORD(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 ( v48 >= v49->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 v50 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 ++v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 memcpy(v50, v49, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 --HIDWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 while ( HIDWORD(v69) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 v62.uNumVertices = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 *(float *)&v74 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 v51 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 v52 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 v80 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 if ( v51 <= v52->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 v53 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 memcpy(v53, v52, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 --LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 while ( v80 != 0.0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 v62.uNumVertices = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 v59 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 v27->_4A2ED5(v59, v60, v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 //----- (0047A384) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 void ODM_LoadAndInitialize(const char *pLevelFilename, OutdoorCamera *thisa)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 unsigned int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 MapInfo *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 SpawnPointMM7 *v6; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 size_t v7; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 char *v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 char Source[120]; // [sp+Ch] [bp-84h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 const char *pFilename; // [sp+84h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 unsigned int v12; // [sp+88h] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 int v13; // [sp+8Ch] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 pFilename = pLevelFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 thisa->AllocSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 pWeather->bRenderSnow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 thisa = (OutdoorCamera *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 GetAlertStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 v2 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 v4 = &pMapStats->pInfos[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 v3 = v4->uRespawnIntervalDays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 v4 = (MapInfo *)thisa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 day_attrib &= 0xFFFFFFFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 dword_6BE13C_uCurrentlyLoadedLocationID = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 pOutdoor->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 pFilename,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 (int)&thisa);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 UpdateLayingItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 thisa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 if ( thisa == (OutdoorCamera *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 if ( (signed int)pOutdoor->uNumSpawnPoints > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 v6 = &pOutdoor->pSpawnPoints[v12 / 0x18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 if ( pOutdoor->pSpawnPoints[v12 / 0x18].uKind == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 SpawnEncounter(v4, v6, v5, v5, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 v4->SpawnRandomTreasure(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 v12 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 if ( v13 >= (signed int)pOutdoor->uNumSpawnPoints )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 RespawnGlobalDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 pOutdoor->PrepareDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 pOutdoor->_47F223_LooksLikeGenerateMonsterLoot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 pOutdoor->InitalizeActors(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 pOutdoor->MessWithLUN();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 v7 = strlen("levels\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 strcpy(Source, &pFilename[v7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 strcpy(pOutdoor->pLevelFilename, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 pWeather->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 pIndoorCamera->sRotationY = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 pIndoorCamera->sRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 pOutdoorCamera->RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 pOutdoor->UpdateSunlightVectors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 pOutdoorCamera->int_fov_rad = (signed __int64)pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 pOutdoorCamera->int_fov_rad_inv = (signed __int64)pIndoorCamera->flt_20_inv_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 v8 = (char *)&array_77EC08[0].ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 *(int *)v8 = (int)&stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 v8 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 while ( (signed int)v8 < (signed int)&unk_801A00 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 v9 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 *((int *)v9 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 *(int *)v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 *((int *)v9 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 v9 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 while ( (signed int)v9 < (signed int)&unk_801A0C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 //----- (0047A825) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 bool LevelDecoration::_47A825()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 bool v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 LevelDecoration *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 if ( pParty->uCurrentHour >= 1 || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 178) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 164)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 165)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 166)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 167)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 168)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 169)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 170)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 171)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 172)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 173)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 174)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 175)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 176)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 177) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 LOBYTE(v2->field_2) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 LOBYTE(v2->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 //----- (0047BC6F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 unsigned __int16 *__fastcall GetBillboardPalette(RenderBillboard *a1, int a2, signed int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 int v6; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 signed int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 signed __int64 v9; // qtt@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 signed int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 int v11; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 signed __int64 v12; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 double v13; // ST10_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 int v14; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 signed int v15; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 signed __int64 v16; // qtt@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 signed int v17; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498 int v18; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 float a3a; // [sp+20h] [bp+8h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 return PaletteManager::Get(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 if ( !pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 v14 = day_fogrange_1 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 if ( a3 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 if ( a3 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 LODWORD(v16) = (a3 - v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 HIDWORD(v16) = (a3 - v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 v15 = (unsigned __int64)(27 * v16 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 v15 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8527 v17 = _43F55F_get_billboard_light_level(a1, v15);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 if ( v17 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 if ( !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 v7 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 v11 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 if ( a4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 LODWORD(v12) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 HIDWORD(v12) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 a3a = (double)(signed int)(((unsigned __int64)(11 * v12 / (pOutdoorCamera->shading_dist_shade << 16)) >> 16) + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 v13 = a3a + 6.7553994e15;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8544 v10 = _43F55F_get_billboard_light_level(a1, LODWORD(v13) + v11);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 if ( v10 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 if ( v10 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 v10 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 if ( v10 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 v10 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 if ( pWeather->field_FA0 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 v8 = 67108864;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 v8 = pParty->pPartyBuffs[16].uPower << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 if ( a3 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 if ( a3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 LODWORD(v9) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 HIDWORD(v9) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 v6 = (unsigned __int64)(27 * v9 / v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 v6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8572 v10 = _43F55F_get_billboard_light_level(a1, v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 if ( v10 > 27 || !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 //----- (0047BEB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 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
8593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 stru148 *v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 signed int v9; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 int v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 signed int v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 signed int v12; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 signed __int64 v13; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 int *v14; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 int *v15; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 int v16; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 signed __int64 v17; // qtt@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 double v18; // ST10_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 double v19; // ST10_8@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 int v20; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 int result; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 int *v22; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 signed int v23; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 signed __int64 v24; // qtt@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 int v25; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 signed int v26; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 float v27; // [sp+28h] [bp+10h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 float v28; // [sp+28h] [bp+10h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 int v29; // [sp+2Ch] [bp+14h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 v8 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 *(char *)a8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 if ( a1 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 v26 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 v9 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 v10 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 if ( !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 v14 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 v15 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 *a5 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 v16 = v8->field_58 - terrain_gamma;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 if ( v16 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 if ( v16 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 v16 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 v28 = pOutdoor->fFogDensity * 27.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 v19 = v28 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 v29 = LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 LODWORD(v17) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 HIDWORD(v17) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 v27 = (double)(signed int)(((unsigned __int64)(v17 / (pOutdoorCamera->shading_dist_shade << 16) * (31 - *a6)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 + *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 v18 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 v29 = LODWORD(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 *v14 = v16 + v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 v20 = *v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 if ( v16 + v29 > v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 *v14 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 if ( *v14 < v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 *v14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 if ( *v14 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 *v14 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 if ( v9 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 if ( v9 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 v23 = v9 - (day_fogrange_1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 LODWORD(v24) = v23 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 HIDWORD(v24) = v23 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 v25 = (unsigned __int64)(27 * v24 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 *a5 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 if ( v25 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 *a5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 *v22 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 *a6 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 *v22 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 if ( v10 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 if ( byte_4D864C && BYTE1(pGame->uFlags) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 v11 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 v12 = v11 << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 if ( v9 <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 if ( v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 LODWORD(v13) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 HIDWORD(v13) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 *a5 = (unsigned __int64)(27 * v13 / v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 if ( *a5 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 if ( v8->field_32 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 *(char *)a8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 //----- (0047C178) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 void *__fastcall sr_sub_47C178(signed int a1, stru148 *a2, int terrain_gamma, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793 int v6; // [sp+4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 int v7; // [sp+8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8799 result = PaletteManager::Get(a2->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 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
8804 result = sr_sub_47C1CA(v4, SBYTE3(a4), v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 //----- (0047C1CA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 void *__fastcall sr_sub_47C1CA(stru148 *a1, char a2, int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 int v6; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 int a3a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8824 result = PaletteManager::Get(a1->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 v6 = pGame->_44EC23(a1, &a3a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 if ( v6 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 if ( v6 != -1 || a4 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8835 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 result = PaletteManager::Get_Mist_or_Red_LUT(v7, v6, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8846 result = PaletteManager::Get_Dark_or_Red_LUT(v4->pTexture->palette_id2, v6, a3a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 //----- (0047C24C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 unsigned __int16 *__fastcall sr_sub_47C24C_get_palette(BLVFace *a1, int a2, int a3, char a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856 int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 int a3a; // [sp+4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 v5 = pGame->_44ED0A(a1, &a3a, 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 if ( v5 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 a3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867 return PaletteManager::Get_Dark_or_Red_LUT(v4, a3, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 //----- (0047C28C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 char *__fastcall sr_sub_47C28C_get_palette(stru148 *a1, char a2, signed int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 char *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 int a2a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 a2a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8883 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8885 result = (char *)pPaletteManager->field_199600_palettes[a1->pTexture->palette_id2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 v6 = pGame->_44EC23(a1, &a2a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 a3 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 if ( a3 != -1 || a4 != -1 )
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8895 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 result = (char *)PaletteManager::_47C30E_get_palette(v7, a2a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8900 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8902 result = (char *)PaletteManager::_47C33F_get_palette(v4->pTexture->palette_id2, a2a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 //----- (0047C370) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 unsigned int __cdecl GetLevelFogColor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 signed __int64 v1; // qax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 result = 0xFF258F5Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 if ( pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 v2 = -(pWeather->field_FA0 != 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929 result = (v2 & 0xE0E0E1) - 0xE0E0E1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 v1 = (signed __int64)((1.0 - pOutdoor->fFogDensity) * 200.0 + pOutdoor->fFogDensity * 31.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 result = v1 | (((unsigned int)v1 | (((unsigned int)v1 | 0xFFFFFF00) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 //----- (0047C3D7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948 int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 double v5; // st7@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 signed int v6; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 signed int v7; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 double v8; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 double v9; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956 double v10; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957 float v11; // ST14_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 double v12; // ST08_8@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 v3 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 if ( pParty->field_1613C || !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 return 0xFF000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 v5 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 if ( a3 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 v8 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 if ( a3 > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 v7 = (signed __int64)((a3 - v5) / (v8 - v5) * 216.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 v9 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 if ( a3 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 v10 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 if ( a3 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 v11 = (a3 - v9) * 216.0 / (v10 - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 v7 = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 if ( v7 > v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 v7 = 248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 return (-1 - v7) << 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018 //----- (0047C4FC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 signed int __fastcall GetActorTintColor(int a1, int a2, float a3, int a4, RenderBillboard *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 signed int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 double v9; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 double v10; // ST0C_8@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 int v11; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 signed int v12; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029 double v13; // ST0C_8@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 double v14; // ST0C_8@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 double v15; // st7@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 double v16; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 double v17; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 int v18; // ST14_4@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 double v19; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 signed int v20; // [sp+10h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 float a3a; // [sp+1Ch] [bp+8h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 float a3b; // [sp+1Ch] [bp+8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 float a3c; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 float a3d; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 float a4b; // [sp+20h] [bp+Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 int a4a; // [sp+20h] [bp+Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 float a4c; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044 float a4d; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 int a5a; // [sp+24h] [bp+10h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 return 8 * (31 - a1) | ((8 * (31 - a1) | ((31 - a1) << 11)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 v8 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 return 16711680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 if ( v8 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9060 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9061 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9062 v20 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9063 v9 = (double)v20 * 1024.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9064 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9065 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9066 if ( a3 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9068 if ( a3 > 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 a4b = a3 * 216.0 / v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 v10 = a4b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 v6 = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 if ( SLODWORD(v10) > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 if ( a3 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 if ( a5 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9085 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096 result = (signed int)0xF8F8F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 v11 = 8 * (a1 - v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9102 if ( v11 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104 if ( v11 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105 v12 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 a3b = pOutdoor->fFogDensity * 216.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 v14 = a3b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 a4a = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 a3a = (a3 / (double)pOutdoorCamera->shading_dist_shade * 32.0 + 216.0) * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 v13 = a3a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 a4a = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 v6 = a4a + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 if ( a5 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9125 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 if ( v6 < v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 v6 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 if ( v6 > 8 * pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 v6 = 8 * pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 if ( !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 v15 = (double)(255 - v6) * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 a3c = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 a4c = v15 * 16.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 v16 = a4c + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 a5a = LODWORD(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 a4d = a3c * 194.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 v17 = a4d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 v18 = LODWORD(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 a3d = a3c * 153.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 v19 = a3d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 result = LODWORD(v19) | ((v18 | (a5a << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 //----- (0047F44B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 int __stdcall WorldPosToGridCellX(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 return (a1 >> 9) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 //----- (0047F458) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 int __stdcall WorldPosToGridCellZ(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163 return 64 - (a1 >> 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 //----- (0047F469) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 int __stdcall GridCellToWorldPosX(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 return (a1 - 64) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 // 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 //----- (0047F476) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 int __stdcall GridCellToWorldPosZ(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 return (64 - a1) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 // 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 //----- (0047F4D3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 void __fastcall sub_47F4D3(int band1, int band2, int band3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 stru220 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 double v5; // ST2C_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 double v6; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 double v7; // [sp+18h] [bp-28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 double v8; // [sp+20h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 int v9; // [sp+34h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 int v10; // [sp+38h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 signed int band3a; // [sp+48h] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 v9 = band2 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 pOutdoorCamera->outdoor_grid_band_3 = band3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 v10 = band1 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 v3 = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 pOutdoorCamera->uPickDepth = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 v4 = stru_76E5C8; // v4: 0 -> 65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 band3a = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 v8 = (double)(signed int)((char *)v4 + 256 - (int)stru_76E5C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 do // band3a: 0 -> 128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 v5 = pow((double)band3a, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 v6 = pow(v8, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 *((float *)&v5 + 1) = sqrt(v6 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 v7 = *((float *)&v5 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 if ( SLODWORD(v7) >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 if ( SLODWORD(v7) >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 v4->field_0 = ((SLODWORD(v7) >= v3) - 1) & 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 v4->field_0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 v4->field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 band3a += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 v4->distance = LOWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 while ( band3a < 65792 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 while ( (signed int)v4 < (signed int)arary_77E5C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 //----- (004811A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 void stru148::_4811A3()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 pBitmaps_LOD->pHardwareTextures[pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid]],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 pBitmaps_LOD->pHardwareTextures[uTileBitmapID],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 //----- (00481DB2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 char __fastcall sr_sub_481DB2(RenderVertexSoft *a1, signed int a2, stru148 *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 signed int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 char *v6; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 double v7; // ST14_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 double v8; // ST0C_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 char result; // al@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 if ( a2 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 v3 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 v4 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 a3->ptr_38 = &stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 a3->pTexture = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 if ( (signed int)a3->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 v6 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 v7 = *((float *)v6 - 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 dword_50B638[v5] = LODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 v8 = *(float *)v6 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 dword_50B570[v5++] = LODWORD(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 while ( v5 < (signed int)a3->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 result = sr_sub_486B4E_push_outdoor_edges(a1, dword_50B638, dword_50B570, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 //----- (00481E55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 void OutdoorCamera::Project(unsigned int uNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 double v1; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 double v2; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 double v3; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 unsigned int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297 double v6; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 double v7; // st3@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 v1 = (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303 v2 = (double)pViewport->uScreenCenterX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 v3 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 v5 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 v6 = v1 * array_507D30[v4].flt_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 v7 = v6 * array_507D30[v4].vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 memcpy(&array_50AC10[v4], &array_507D30[v4], sizeof(array_50AC10[v4]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 array_50AC10[v4].vWorldViewProjX = v2 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 array_50AC10[v4].vWorldViewProjY = v3 - v6 * array_507D30[v4].vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 //----- (00481EB7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 void __cdecl ResetStru148s()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324 int v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 v0 = pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 if ( pOutdoorCamera->numStru148s > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 v1 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 *((int *)v1 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 *(int *)v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 *((int *)v1 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 v1 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 while ( v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 //----- (00481ED9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 void __cdecl sub_481ED9_MessWithOutdoorCamera()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 pOutdoorCamera->numStru148s = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 pOutdoorCamera->uNumEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 pOutdoorCamera->uNumSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 pOutdoorCamera->uNumSurfs = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9351 pOutdoorCamera->uNumBillboards = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 pOutdoorCamera->field_44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 //----- (00481EFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 RenderVertexSoft *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 RenderVertexSoft *v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 bool v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 bool v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 bool v9; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 bool v10; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 double v11; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 signed int v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 signed int v13; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 signed int v14; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 signed int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 RenderVertexSoft *v17; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 v6 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 v17 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 v7 = a1->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 v8 = v5->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 v9 = a3->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 v10 = a4->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 return !(v8 & v9 & v10 & v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 && ((v11 = (double)pOutdoorCamera->shading_dist_mist, v11 > v6->vWorldViewPosition.x) ? (v12 = 0) : (v12 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 v11 > v17->vWorldViewPosition.x ? (v13 = 0) : (v13 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 v11 > a3->vWorldViewPosition.x ? (v14 = 0) : (v14 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 v11 > a4->vWorldViewPosition.x ? (v15 = 0) : (v15 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 !(v13 & v14 & v15 & v12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 //----- (00481FC9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 int __fastcall sub_481FC9(RenderVertexSoft *_ECX, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 /*signed int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 __int64 v11; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 __int64 v12; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 __int64 v13; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 __int64 v14; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 __asm { fld dword ptr [ecx+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 _ESI = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 _EDX = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 __asm { fcomp dword ptr [esi+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 _EDI = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 __asm { fnstsw ax }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 fld dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 fcomp dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 *(int *)&a4->flags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 fld dword ptr [ecx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 fstp [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 fld dword ptr [ecx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 fstp [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 fld dword ptr [ecx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 fstp [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 fld dword ptr [edx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 fstp [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 fld dword ptr [edx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 fstp [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 fld dword ptr [edx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 fstp [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 fld dword ptr [ecx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 fld dword ptr [ecx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 fld dword ptr [ecx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 fld dword ptr [edx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 fld dword ptr [edx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 fld dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 fld st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 fild pIndoorCamera->pos.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 fmul st, st(6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 fld st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 fild pIndoorCamera->pos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 fmul st, st(7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 fild pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 fcomp ds:flt_4D84E8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 if ( __SETP__(HIBYTE(_AX) & 0x41, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 _EDI->v_18.x = v11;
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 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 _EDI->v_18.y = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 _EDI->v_18.z = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 stru148::_486089_normalize_v_18(_EDI);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 fild dword ptr [edi+18h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 fmul dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 fchs
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 fild dword ptr [edi+1Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 fmul dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 fild dword ptr [edi+20h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 fmul dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 _EDI->field_24 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 //----- (004823F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 bool __fastcall GetTerrainHeightsAroundParty(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 unsigned int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 int v6; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 int v9; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 int v11; // [sp+14h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 int v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 v12 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 v2 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 v3 = WorldPosToGridCellZ(v11) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 dword_76D568_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 dword_76D56C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 dword_76D570_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 dword_76D574_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 dword_76D558_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 dword_76D55C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 dword_76D560_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 dword_76D564_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 dword_76D548_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 dword_76D54C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 dword_76D550_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 v4 = pOutdoor->DoGetHeightOnTerrain(v2, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 dword_76D554_terrain_cell_world_pos_around_party_y = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 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
9583 && 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
9584 && dword_76D550_terrain_cell_world_pos_around_party_y == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 v6 = abs(v12 - dword_76D568_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 if ( abs(dword_76D558_terrain_cell_world_pos_around_party_z - v11) >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 v7 = dword_76D554_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 v8 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 v9 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 v7 = dword_76D54C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 v8 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 v9 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601 v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 if ( v8 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 if ( v7 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 v10 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 if ( v7 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 if ( v8 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 if ( v7 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 return v9 - v10 > 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 //----- (0048257A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 unsigned int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 unsigned int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 int v7; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 int v8; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 int v9; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 int v11; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 int v12; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 int v13; // [sp+10h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 signed int v14; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 int v15; // [sp+24h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 v11 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 v12 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 v4 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 v5 = WorldPosToGridCellZ(v12) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 dword_76D538_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 dword_76D53C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 dword_76D540_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 dword_76D544_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 dword_76D528_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 dword_76D52C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 dword_76D530_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 dword_76D534_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 dword_76D518_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 dword_76D51C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 dword_76D520_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 dword_76D524_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 *a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 if ( pOutdoor->ActuallyGetSomeOtherTileInfo(v4, v5) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 *a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 if ( !a4 && *a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 v14 = -60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 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
9665 || 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
9666 || 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
9667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 v7 = abs(v11 - dword_76D538_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 if ( abs(dword_76D528_terrain_cell_world_pos_around_party_z - v12) >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 v8 = dword_76D524_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 v9 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 v10 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 v15 = v11 - dword_76D544_terrain_cell_world_pos_around_party_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 v13 = v12 - dword_76D534_terrain_cell_world_pos_around_party_z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 v8 = dword_76D51C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 v9 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 v10 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 v15 = dword_76D53C_terrain_cell_world_pos_around_party_x - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 v13 = dword_76D52C_terrain_cell_world_pos_around_party_z - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 result = v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 + ((unsigned __int64)(v13 * (signed __int64)((v10 - v8) << 7)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 + ((unsigned __int64)(v15 * (signed __int64)((v9 - v8) << 7)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 result = v14 + dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 //----- (0048276F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 void stru148::_48276F_sr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 float v2; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 char *v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 float v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 float v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 float v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 float v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 int i; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 int v10; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 RenderVertexSoft *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 RenderVertexSoft *v12; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 RenderVertexSoft *v13; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 int v14; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 RenderVertexSoft *v15; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 double v16; // st6@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 double v17; // st5@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 double v18; // st4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 int v19; // [sp+4h] [bp-2Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 int v20; // [sp+8h] [bp-28h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 int v21; // [sp+Ch] [bp-24h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 stru148 *v22; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 float v23; // [sp+14h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 float v24; // [sp+18h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 float v25; // [sp+1Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 float v26; // [sp+20h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 float v27; // [sp+24h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 float v28; // [sp+28h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 float v29; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 v1 = this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 v22 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 if ( (signed int)v1 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 LODWORD(v2) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 v26 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v28 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 v3 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 v27 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 if ( (signed int)v1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 v4 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 if ( *((float *)v4 - 1) < (double)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 LODWORD(v5) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 v25 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 v26 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 if ( *((float *)v4 - 1) > (double)v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 LODWORD(v6) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 v27 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 if ( *(float *)v4 < (double)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 LODWORD(v7) = *(int *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 v29 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 v28 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 if ( v3 < *(float *)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 v3 = *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 v23 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 ++LODWORD(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 v4 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 while ( SLODWORD(v2) < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v8 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 if ( LODWORD(v29) == LODWORD(v25) || LODWORD(v29) == LODWORD(v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 v8 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 v29 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 for ( i = 0; i < (signed int)v1; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 if ( i == LODWORD(v25) || i == LODWORD(v24) || i == LODWORD(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 v10 = LODWORD(v29)++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 *(&v19 + v10) = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 v11 = &array_508690[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 v12 = &array_508690[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 v13 = &array_508690[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 if ( LODWORD(v29) != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 v11 = array_508690;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 v13 = (RenderVertexSoft *)((char *)array_508690 + 16 * (3 * v1 - 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 v12 = &array_508690[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 v28 = array_508690[1].vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 v27 = array_508690[1].vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 v29 = array_508690[1].vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 v26 = v13->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 v25 = v13->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 v24 = v13->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 if ( v24 * v27 - v25 * v29 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 if ( v26 * v29 - v24 * v28 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 if ( v25 * v28 - v26 * v27 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 v14 = v1 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 LODWORD(v26) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 if ( v14 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 v15 = &array_508690[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 v16 = v15->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 v17 = v15->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 v18 = v15->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 v13 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 if ( v27 * v18 - v17 * v29 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 if ( v16 * v29 - v18 * v28 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 if ( v28 * v17 - v16 * v27 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 --LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 --v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 while ( SLODWORD(v26) >= 2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 sr_sub_4829B9(v11, v12, v13, v22, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 //----- (004829B9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 stru148 *__fastcall sr_sub_4829B9(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 double v5; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 RenderVertexSoft *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 double v7; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 stru148 *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 double v9; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 double v10; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 float v11; // ST0C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 float v12; // ST04_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 double v13; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 float v14; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 float v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 float v16; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 float v17; // [sp+1Ch] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 v5 = a2->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 v16 = a3->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 v15 = a2->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 v14 = v6->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 v7 = v16 * v5 - v14 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 v7 = 0.0000001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 v9 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 v10 = 1.0 / a1->vWorldViewPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 v11 = 1.0 / a2->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 v12 = 1.0 / v6->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 v13 = (v11 * v16 - v12 * v15) * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 v17 = (v11 * v14 - v12 * v5) * -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 a4->field_C = a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 a4->field_10 = a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 a4->field_0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 a4->field_8 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 a4->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 //----- (00482A90) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 signed int __cdecl const_1_0()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 //----- (00482A94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 int sr_sub_482A94(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 signed int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 int v14; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 signed __int64 v15; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 stru149 *v16; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 signed int v17; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 Texture *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 unsigned __int16 *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 stru149 *v20; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 signed int v21; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 int v22; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 Texture *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 signed int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 signed int v27; // [sp-4h] [bp-A4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 int v28; // [sp+Ch] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 int v29; // [sp+10h] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 stru316 a2; // [sp+14h] [bp-8Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 stru315 a1; // [sp+3Ch] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 int v32; // [sp+80h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 int v33; // [sp+84h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 int v34; // [sp+88h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 int v35; // [sp+8Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 int v36; // [sp+90h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 int v37; // [sp+94h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 int v38; // [sp+98h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 int X; // [sp+9Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 v37 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 v7 = v38 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 v37 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 v8 = ((unsigned __int64)(v37 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 v37 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 v9 = v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 v28 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 v35 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 v10 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 v29 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 v32 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 v11 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 v37 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 v12 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 v13 = -v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 v36 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 X = ((unsigned __int64)(v37 * (signed __int64)v12) >> 16) + v38 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 if ( !X || (v14 = abs(v13 >> 14), v14 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 LODWORD(v15) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 HIDWORD(v15) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 v38 = v15 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 v16 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 v36 = v16->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 v36 = v33 + ((unsigned __int64)(v36 * (signed __int64)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 v33 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 X = (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 v34 += (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 if ( v38 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 if ( v38 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 if ( v38 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 v27 = 3;
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 v27 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 v17 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 if ( v17 < (signed int)v3->ptr_48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 v17 = (signed int)v3->ptr_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 v18 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 v19 = (unsigned __int16 *)v18->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 if ( v17 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 v19 = (unsigned __int16 *)v18->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 v19 = (unsigned __int16 *)v18->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 v19 = (unsigned __int16 *)v18->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 a1.pTextureLOD = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 X = (unsigned __int64)(v36 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 v20 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 X = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 a1.field_30 = v28 + ((unsigned __int64)(v36 * (signed __int64)v38) >> 16) - v20->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 X = (unsigned __int64)(v34 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 v21 = X - v3->ptr_38->field_28 - v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 a1.field_30 >>= v17 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 a1.field_2C = v21 >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 v35 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 v37 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v38) >> 16) >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 a1.field_4 = (unsigned __int64)(v37 * (signed __int64)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 X = (unsigned __int64)(v37 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 a1.field_0 = -(signed int)((unsigned __int64)(v37 * (signed __int64)v32) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 v22 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 a1.pColorBuffer = &pRenderer->pTargetSurface[v2->field_8 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 HIWORD(v23) = HIWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v2->field_8 + 640 * v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 LOWORD(v23) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 a1.field_24 = v23 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 v32 = (signed int)v24->uTextureWidth >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 v25 = (signed int)v24->uTextureHeight >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 a1.field_10 = v17 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 a1.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 a1.field_8 = (v25 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 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
10040 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 //----- (00482E07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 signed int __fastcall sr_sub_482E07(Span *ecx0, unsigned __int16 *pRenderTarget)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 stru149 *v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 int v8; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 int v10; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 unsigned __int64 v12; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 signed __int64 v14; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 int v15; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 signed __int64 v16; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 int v17; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 unsigned __int16 *v18; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 Texture *v19; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 Texture *v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 Texture *v21; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 Texture *v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 int v23; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 Texture *v24; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 signed int v25; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 signed int v26; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 char v27; // bl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 stru149 *v28; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 stru149 *v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 int v30; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 int v31; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 unsigned int v32; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 int v33; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 signed __int64 v34; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 signed int v35; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 int v36; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 stru149 *v37; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 int v38; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 int v39; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 int v40; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 signed __int64 v41; // qtt@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 int v42; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 stru149 *v43; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092 int v44; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 int v45; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 Span *v46; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 stru149 *v47; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 stru149 *v48; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 int v49; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 int v50; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 unsigned int v51; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 int v52; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 signed __int64 v53; // qtt@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 unsigned int v54; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 int v55; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 stru149 *v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 int v57; // edi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 int v58; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 int v59; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 signed __int64 v60; // qtt@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 int v61; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 stru149 *v62; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 int v63; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 int v64; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 int v66; // [sp+Ch] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 int v67; // [sp+10h] [bp-B4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 int v68; // [sp+14h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 int v69; // [sp+18h] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 int v70; // [sp+1Ch] [bp-A8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 int v71; // [sp+20h] [bp-A4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 signed int v72; // [sp+24h] [bp-A0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 stru316 a2; // [sp+28h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 int v74; // [sp+50h] [bp-74h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 stru315 a1; // [sp+54h] [bp-70h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 Span *v76; // [sp+98h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 unsigned __int16 *v77; // [sp+9Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 int v78; // [sp+A0h] [bp-24h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 int v79; // [sp+A4h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 int v80; // [sp+A8h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 int v81; // [sp+ACh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 int X; // [sp+B0h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 int v83; // [sp+B4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 int v84; // [sp+B8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 int v85; // [sp+BCh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 int v86; // [sp+C0h] [bp-4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 v85 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 v3 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 v4 = pViewport->uScreenCenterY - ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 v77 = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v5 = pOutdoorCamera->int_fov_rad_inv * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 v76 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 v83 = v6->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 v7 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 v8 = v81 + v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 v83 = v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 v67 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 v9 = ((unsigned __int64)(v83 * (signed __int64)v5) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 v71 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 v83 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 v68 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 v69 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 v72 = -v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 v10 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - ecx0->field_8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 v11 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 v66 = v81 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 v83 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 v12 = v10 * (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 v81 = v12 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 v13 = v66 + (v12 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 v84 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 if ( !v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 || (X = v72 >> 15, v83 = abs(v13), abs(v72 >> 15) >= v83)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 || (LODWORD(v14) = v72 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 HIDWORD(v14) = v72 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 v79 = v14 / v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 v80 = v10 - v85 * pOutdoorCamera->int_fov_rad_inv,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 v81 = (unsigned __int64)(v80 * (signed __int64)v3->v_18.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 (v84 = v66 + v81) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 || (v15 = abs(v66 + v81), abs(X) >= v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 LODWORD(v16) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 HIDWORD(v16) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 v70 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 v17 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 a1.field_24 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 if ( v79 >= v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 a1.field_24 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 v18 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 if ( a1.field_24 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 if ( a1.field_24 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 if ( a1.field_24 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 v84 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 v18 = (unsigned __int16 *)v22->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 v21 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 v18 = (unsigned __int16 *)v21->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 v18 = (unsigned __int16 *)v20->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 v19 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 v18 = (unsigned __int16 *)v19->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 a1.pTextureLOD = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 v23 = v3->field_5A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 v83 = v3->field_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 v74 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 v78 = v85 >> v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 v25 = v24->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 v81 = v85 - (v85 >> v23 << v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 v26 = (signed int)v24->uTextureHeight >> v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 a1.field_10 = v84 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 v27 = v84 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 a1.field_8 = (v26 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 a1.field_C = (v25 >> v84) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 if ( v79 >= v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 v46 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 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
10237 v47 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 v86 = v47->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 v79 = (unsigned __int64)(v84 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 v48 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 v79 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v70) >> 16) - v48->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 v79 = (unsigned __int64)(v86 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 v49 = ((unsigned __int64)(v86 * (signed __int64)v70) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 a1.field_2C = (v69 + v49) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 v50 = v46->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 v51 = v50 + pRenderer->uTargetSurfacePitch * v46->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 a1.pDepthBuffer = (unsigned int *)(&pRenderer->pActiveZBuffer[640 * v46->field_A - 1] + v85 + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 a1.pColorBuffer = &v77[v85 - 1] + v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 v77 = (unsigned __int16 *)v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 v84 = v66 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 if ( v66 + (unsigned int)((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 && (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
10270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 LODWORD(v53) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 HIDWORD(v53) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 v86 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 v54 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 v84 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 v84 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 v54 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 HIWORD(v55) = HIWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 LOWORD(v55) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 a1.field_24 = v3->field_50 | v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 v77 = (unsigned __int16 *)v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 v77 = (unsigned __int16 *)(v67 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 v56 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 v57 = ((unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16) - v56->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 v77 = (unsigned __int16 *)v56->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 v77 = (unsigned __int16 *)(v71 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 v58 = (((v69 + v86 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 a1.field_4 = (((v68 + v57) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 a1.field_0 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 v86 = (unsigned __int64)(v83 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 v59 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 if ( abs(X) < v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 LODWORD(v60) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 HIDWORD(v60) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 v86 = v60 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 HIWORD(v61) = (unsigned int)(v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 LOWORD(v61) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 a1.field_24 = v61 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 v62 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 v63 = ((unsigned __int64)(v83 * v60 / v84) >> 16) - v62->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 v83 = v62->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 v64 = (((signed int)(v69 + ((unsigned __int64)(v83 * v60 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 a1.field_4 = (((v68 + v63) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 a1.field_0 = v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 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
10374 v28 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 v86 = v28->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 v85 = (unsigned __int64)(v84 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 v29 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 v85 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v79) >> 16) - v29->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 v85 = (unsigned __int64)(v86 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 v30 = ((unsigned __int64)(v86 * (signed __int64)v79) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 a1.field_2C = (v69 + v30) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 v31 = v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 v32 = pRenderer->uTargetSurfacePitch * v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 v86 = v76->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 a1.pColorBuffer = &v77[v86 + v32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v86 + 640 * v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 v80 = v10 - (pOutdoorCamera->int_fov_rad_inv << v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 v86 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 v78 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 v85 = (unsigned __int64)(v78 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 v84 = v66 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 if ( v66 + (unsigned int)((unsigned __int64)(v78 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 && (v33 = abs((signed __int64)v66 + ((__int64)(v78 * (signed __int64)v80) >> 16)), abs((signed __int64)X) < v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 LODWORD(v34) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 HIDWORD(v34) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 v85 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 v35 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 v84 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 v84 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 v35 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 HIWORD(v36) = HIWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 LOWORD(v36) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 a1.field_24 = v3->field_50 | v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 v78 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 v78 = v67 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 v37 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 v38 = ((unsigned __int64)(v78 * (signed __int64)v35) >> 16) - v37->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 v78 = v37->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 v78 = v71 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 v39 = (((v69 + v85 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 a1.field_4 = (((v68 + v38) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 a1.field_0 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 v80 -= pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 --v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 while ( v86 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 v76 = (Span *)((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 v40 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 if ( abs(X) < v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 LODWORD(v41) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 HIDWORD(v41) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 X = v41 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 HIWORD(v42) = (unsigned int)(v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 LOWORD(v42) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 a1.field_24 = v42 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 v43 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 v44 = ((unsigned __int64)(v83 * v41 / v84) >> 16) - v43->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 v83 = v43->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 v45 = (((signed int)(v69 + ((unsigned __int64)(v83 * v41 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 a1.field_4 = (((v68 + v44) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 a1.field_0 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 //----- (004839BD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 signed int __fastcall sr_sub_4839BD(Span *ecx0, unsigned __int16 *pTargetSurface)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 unsigned int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 stru149 *v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 int v12; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 int v14; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 int v16; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 signed int v17; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 int v18; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 signed __int64 v19; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 int v20; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 unsigned __int16 *v21; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 Texture *v22; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 Texture *v23; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 Texture *v24; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 Texture *v25; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 int v27; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 signed int v28; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 Texture *v29; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 int v30; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 signed int v31; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 signed int v32; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 int v34; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 int v35; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 int v36; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 int v37; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 signed __int64 v38; // qtt@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 int v39; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 int v40; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 stru149 *v41; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 int v42; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 int v43; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 int v44; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 char v45; // zf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 int v46; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 int v47; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 int v48; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 int v49; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 signed __int64 v50; // qtt@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 int v51; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 int v52; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 int v53; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 stru149 *v54; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 int v55; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 signed int v56; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 int v57; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 unsigned __int64 v58; // qax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 int v60; // [sp+Ch] [bp-BCh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 Span *v61; // [sp+10h] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 int v62; // [sp+14h] [bp-B4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 int v63; // [sp+18h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 stru315 a1; // [sp+1Ch] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 stru316 a2; // [sp+60h] [bp-68h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 int v66; // [sp+88h] [bp-40h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 int v67; // [sp+8Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 int v68; // [sp+90h] [bp-38h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 int v69; // [sp+94h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 int v70; // [sp+98h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 int v71; // [sp+9Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 int v72; // [sp+A0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 int v73; // [sp+A4h] [bp-24h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 int v74; // [sp+A8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 int v75; // [sp+ACh] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 int v76; // [sp+B0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 int v77; // [sp+B4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 int X; // [sp+B8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 int v79; // [sp+BCh] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 int v80; // [sp+C0h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 unsigned int v81; // [sp+C4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 v3 = ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 v4 = ecx0->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 v5 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 v6 = v4 + pRenderer->uTargetSurfacePitch * ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 v61 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 v7 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 a1.pColorBuffer = &pTargetSurface[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 v74 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v4 + 640 * v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 v9 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 v10 = v5->ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 v76 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 v72 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 v81 = (unsigned __int64)(v10 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 v11 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 v12 = v81 + v11->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 v72 = v11->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 v67 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 v13 = ((unsigned __int64)(v72 * (signed __int64)v9) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 v81 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 v70 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 v72 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 v81 = (unsigned __int64)(v72 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 v14 = v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 v15 = v81 + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 v71 = v5->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 v63 = v5->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 v16 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 v17 = -v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 v60 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 v81 = (unsigned __int64)(v76 * (signed __int64)v16) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 X = v81 + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 if ( !(v81 + v15) || (v62 = v17 >> 14, v18 = abs(v17 >> 14), v18 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 LODWORD(v19) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 HIDWORD(v19) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 v69 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 v20 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 v21 = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 a1.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 if ( v20 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 if ( v20 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 if ( v20 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 v25 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 v75 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 v21 = (unsigned __int16 *)v25->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 v21 = (unsigned __int16 *)v24->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 v21 = (unsigned __int16 *)v23->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 v21 = (unsigned __int16 *)v22->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 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
10685 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 v66 = v74 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 v72 = v74 - 16 * (v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 v76 = v26->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 v74 = v67 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 v76 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 v76 = v70 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 v81 = (unsigned __int64)(v74 * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 v27 = ((unsigned __int64)(v74 * (signed __int64)v20) >> 16) - v5->ptr_38->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 v81 = (unsigned __int64)(v76 * (signed __int64)v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 v28 = v63 + ((unsigned __int64)(v76 * (signed __int64)v69) >> 16) - v5->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 v76 = v75 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 v73 = v8 - 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 v30 = (v71 + v27) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 v31 = v28 >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 v32 = (signed int)v29->uTextureWidth >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 v74 = (signed __int16)v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 v68 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 v80 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 v33 = (signed int)v29->uTextureHeight >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 v34 = v75 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 a1.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 v81 = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 a1.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 a1.field_C = v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 if ( v66 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 v74 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 v80 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 v35 = (unsigned __int64)(v80 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 v36 = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 X = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 if ( v35 + v60 && (v80 = abs(v62), v37 = abs(v36), v80 <= v37) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 LODWORD(v38) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 HIDWORD(v38) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 v80 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 v39 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 X = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 X = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 v39 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 HIWORD(v40) = HIWORD(v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 if ( v39 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 HIWORD(v40) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 LOWORD(v40) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 a1.field_24 = v5->field_50 | v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 v41 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 v42 = ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v41->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 v79 = v41->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 v79 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 v43 = (v71 + v42) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 v79 = (signed int)(v63 + ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 a1.field_4 = (v43 - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 a1.field_0 = (v79 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v68 >> v66));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 v44 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 a1.field_2C = v68 + 4 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 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
10762 v73 -= 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 v45 = v74-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 v30 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 while ( !v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 v31 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 if ( !v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v31 >> (12 - v75)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 v46 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 a1.field_2C = v68 + 4 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 v79 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 v80 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 v47 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 v48 = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 X = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 if ( v47 + v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 v79 = abs(v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 v49 = abs(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 if ( v79 <= v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 LODWORD(v50) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 HIDWORD(v50) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 v77 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 v51 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 HIWORD(v52) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 if ( v51 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 LOWORD(v52) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 a1.field_24 = v52 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 HIWORD(v53) = HIWORD(v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 LOWORD(v53) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 a1.field_24 = v53 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 v77 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 v67 = (unsigned __int64)(v79 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 v54 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 v55 = v67 - v54->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 v79 = v54->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 v56 = v71 + v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 v71 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813 v57 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 v79 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 v58 = v57 * (signed __int64)v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 v70 = v58 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 LODWORD(v58) = (signed int)(v63 + (v58 >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 a1.field_4 = ((v56 >> v76) - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819 a1.field_0 = ((signed int)v58 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 a1.field_28 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 //----- (0048408A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 signed int sr_sub_48408A_prolly_odm_water_no_waves(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 int v14; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 signed int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 int v16; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 stru149 *v18; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 int v19; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 Texture *v20; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 Texture *v23; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 stru149 *v25; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 signed int v26; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 int v27; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 int v28; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 int v29; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 int v30; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 Texture *v31; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 int v32; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 int v33; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 int v35; // [sp+Ch] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 int v36; // [sp+10h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 stru316 a2; // [sp+14h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 stru315 a1; // [sp+3Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 int v39; // [sp+80h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 int v40; // [sp+84h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 int v41; // [sp+88h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 int v42; // [sp+8Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 int v43; // [sp+90h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 int v44; // [sp+94h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 v42 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 v7 = v44 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 v42 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 v39 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v8 = ((unsigned __int64)(v42 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 v42 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 v9 = v44 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 v36 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 v42 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v14 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v15 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 v40 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 v16 = ((unsigned __int64)(v42 * (signed __int64)v14) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 v44 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 if ( !v16 || (v43 = abs(v15 >> 14), v43 > abs(v16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 LODWORD(v17) = v40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 HIDWORD(v17) = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 v43 = v17 / v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 v18 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 v40 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 v40 = v39 + ((unsigned __int64)(v40 * (signed __int64)v42) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 v39 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 v44 = (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 v19 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 v41 += (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 if ( v43 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 v21 = (unsigned __int16 *)v20->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 if ( v43 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 v21 = (unsigned __int16 *)v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 if ( v43 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 v44 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 v21 = (unsigned __int16 *)v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 v23 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 a1.pTextureLOD = (unsigned __int16 *)v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 v43 = (unsigned __int64)(v40 * (signed __int64)v43) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 v25 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 v43 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 a1.field_30 = ((unsigned __int64)(v40 * (signed __int64)v19) >> 16) - v25->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 v43 = (unsigned __int64)(v41 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 v26 = ((unsigned __int64)(v41 * (signed __int64)v19) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 v27 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 v41 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 a1.field_2C = v26 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 v41 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 v42 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v19) >> 16) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 a1.field_4 = (unsigned __int64)(v42 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 v43 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 a1.field_0 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 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
10987 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 v28 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 v29 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 a1.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 v30 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 a1.pColorBuffer = &pRenderer->pTargetSurface[v30 + pRenderer->uTargetSurfacePitch * v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v30 + 640 * v28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 v31 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 v32 = ((signed int)v31->uTextureWidth >> v44) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 v33 = ((signed int)v31->uTextureHeight >> v44 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 a1.field_10 = v44 - v31->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 a1.field_C = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 a1.field_8 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 //----- (00484442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 signed int sr_sub_484442(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 int v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 signed int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 int v15; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 signed __int64 v16; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 int v17; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 int v18; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 signed int v20; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 stru149 *v22; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 signed int v23; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 int v24; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 int v25; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 unsigned int *v26; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 Texture *v27; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 signed int v28; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 signed int v29; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 signed int v31; // [sp+Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 int v32; // [sp+10h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 int v33; // [sp+14h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 stru316 v34; // [sp+18h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 stru315 v35; // [sp+40h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 int v36; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 int v37; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 int v38; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 int v39; // [sp+90h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 int v40; // [sp+94h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 int v41; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 v39 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 v7 = v40 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 v39 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 v36 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 v8 = ((unsigned __int64)(v39 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 v39 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 v9 = v40 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 v32 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 v33 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 v35.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 v41 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 v14 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 v31 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 v15 = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * v12 * (signed __int64)v3->v_18.y) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 v37 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 if ( !v15 || (v39 = abs(v14 >> 14), v39 > abs(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 LODWORD(v16) = v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 HIDWORD(v16) = v31 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 v40 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 v17 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 v18 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 HIWORD(v19) = (unsigned int)(v16 / v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 v35.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 v37 = v36 + ((unsigned __int64)(v3->ptr_38->field_10 * (signed __int64)v41) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 v36 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 v41 = (unsigned __int64)(v36 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 v38 += (unsigned __int64)(v36 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v35.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 if ( v17 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 v35.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 if ( v17 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 if ( v17 < mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 v20 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v41 = (unsigned __int64)(v37 * (signed __int64)v17) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v22 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 v41 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v35.field_30 = ((unsigned __int64)(v37 * (signed __int64)v17) >> 16) - v22->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 v23 = ((unsigned __int64)(v38 * (signed __int64)v17) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 v24 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 v35.field_30 >>= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 v38 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 v35.field_2C = v23 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 v35.field_14 = dword_80AA20 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 v35.field_18 = dword_80AA1C >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 v35.field_1C = dword_80AA18 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 v35.field_20 = dword_80AA14 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 v38 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 v39 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v40) >> 16) >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 v35.field_4 = (unsigned __int64)(v39 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 v41 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 v35.field_0 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 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
11156 v25 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 v26 = (unsigned int *)&pRenderer->pActiveZBuffer[v25 + 640 * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 v35.pColorBuffer = &pRenderer->pTargetSurface[v25 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 v35.pDepthBuffer = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 v27 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 v28 = (signed int)v27->uTextureWidth >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 v29 = (signed int)v27->uTextureHeight >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 v35.field_10 = v20 - v27->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 v35.field_C = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 v35.field_8 = (v29 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 sr_sub_485D3E(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 sr_sub_485C89(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 sr_sub_4D72EC(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 sr_sub_4D73DF(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 //----- (004847EB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 int sr_sub_4847EB(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 int v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 int v7; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 stru149 *v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 stru149 *v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 int v10; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 int v11; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 signed int v12; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 int v13; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 signed __int64 v14; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 signed int v16; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 unsigned __int16 *v17; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 stru149 *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 stru149 *v19; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 signed int v20; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 int v21; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 Texture *v22; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 signed int v23; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 int v24; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 int v25; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 int v26; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 int v27; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 int v28; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 int v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 signed __int64 v30; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 int v31; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 int v32; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 stru149 *v33; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 signed int v34; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 int v35; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 signed int v36; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 signed __int64 v37; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 signed int v38; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 int v39; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 int v40; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 unsigned __int64 v41; // qax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 int v42; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 int v43; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 signed __int64 v44; // qtt@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 int v45; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 int v46; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 stru149 *v47; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 signed int v48; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 int v49; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 int v50; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 unsigned __int64 v51; // qax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 int v52; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 int v53; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 signed __int64 v54; // qtt@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 int v55; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 int v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 stru149 *v57; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 signed int v58; // edi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 int v59; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 Span *v61; // [sp+Ch] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 int v62; // [sp+10h] [bp-ACh]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 int v63; // [sp+14h] [bp-A8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 int v64; // [sp+18h] [bp-A4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 int v65; // [sp+1Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 signed int v66; // [sp+20h] [bp-9Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 signed int v67; // [sp+24h] [bp-98h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 int v68; // [sp+28h] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 char v69; // [sp+2Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 stru315 sr; // [sp+30h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 stru316 sr2; // [sp+74h] [bp-48h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 int v72; // [sp+9Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 int v73; // [sp+A0h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 int v74; // [sp+A4h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 int v75; // [sp+A8h] [bp-14h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 int v76; // [sp+ACh] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 int v77; // [sp+B0h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 int v78; // [sp+B4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 int v79; // [sp+B8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 v2 = _this->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 v3 = _this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 v4 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 v61 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 sr.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 v5 = _this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 sr.pColorBuffer = &pRenderer->pTargetSurface[v3 + pRenderer->uTargetSurfacePitch * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 v68 = texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 v69 = texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 if ( v5 >= texmapping_terrain_subdivsize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 v73 = texmapping_terrain_subdivsize - (v3 & (texmapping_terrain_subdivsize - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 v6 = v5 - v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 v67 = v6 >> texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 v62 = v6 - (v6 >> texmapping_terrain_subdivpow2 << texmapping_terrain_subdivpow2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 v8 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 v79 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 v76 = v8->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 v9 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 v10 = v78 + v9->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 v76 = v9->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 v65 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 v11 = ((unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 + v4->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 v64 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 v76 = v4->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 v12 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 v63 = v78 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 v66 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 v78 = (unsigned __int64)(v79 * (signed __int64)v4->v_18.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 v74 = v78 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 if ( !(v78 + v63) || (v76 = v12 >> 14, v13 = abs(v12 >> 14), v13 > abs(v74)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 LODWORD(v14) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 HIDWORD(v14) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 v72 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 sr.pTextureLOD = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 v15 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 if ( v15 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 if ( v15 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 if ( v15 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 v16 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 sr.pTextureLOD = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 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
11341 v18 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 v79 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 v77 = v65 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 v79 = v4->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 v79 = v64 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 v78 = (unsigned __int64)(v77 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 v19 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 v78 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 sr.field_30 = ((unsigned __int64)(v77 * (signed __int64)v72) >> 16) - v19->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 v78 = (unsigned __int64)(v79 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 v20 = ((unsigned __int64)(v79 * (signed __int64)v72) >> 16) - v4->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 v21 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 sr.field_30 >>= v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 v78 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 sr.field_2C = v20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 sr.field_14 = dword_80AA20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 sr.field_18 = dword_80AA1C >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 sr.field_1C = dword_80AA18 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 sr.field_20 = dword_80AA14 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 v22 = v4->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 v79 = (signed int)v22->uTextureWidth >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 v23 = (signed int)v22->uTextureHeight >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 v24 = v16 - v22->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 sr.field_8 = (v23 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 sr.field_10 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 sr.field_C = v79 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 v25 = v7 - v73 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 v77 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 v79 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 v27 = (unsigned __int64)(v77 * (signed __int64)v25) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 v28 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 v74 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 if ( !(v27 + v63) || (v77 = abs(v76), v29 = abs(v28), v77 > v29) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 LODWORD(v30) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 HIDWORD(v30) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 v77 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 v31 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 HIWORD(v32) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 if ( v72 <= v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 HIWORD(v32) = HIWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 LOWORD(v32) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 sr.field_24 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 v74 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 v74 = v65 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 v33 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 v34 = ((unsigned __int64)(v74 * (signed __int64)v31) >> 16) - v33->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 v74 = v33->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 v74 = v64 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 v35 = (v77 - v4->ptr_38->field_28) >> v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 v74 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 v36 = (v34 >> v78) - sr.field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 LODWORD(v37) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 HIDWORD(v37) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 v38 = v35 - sr.field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 sr.field_4 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 v75 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 LODWORD(v37) = v38 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 HIDWORD(v37) = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 v77 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 sr.field_0 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 sr.field_28 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 v39 = v79 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 v79 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 v39 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 while ( v67 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 v40 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 v75 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 v41 = v40 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 v79 = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 LODWORD(v41) = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 v42 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 v74 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 if ( !((int)v41 + v63) || (v75 = abs(v76), v43 = abs(v42), v75 > v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 LODWORD(v44) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 HIDWORD(v44) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 v73 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 v45 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 HIWORD(v46) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 if ( v72 <= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 HIWORD(v46) = HIWORD(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 LOWORD(v46) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 sr.field_24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 v47 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 v48 = ((unsigned __int64)(v75 * (signed __int64)v45) >> 16) - v47->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 v75 = v47->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 v49 = (((v79 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 sr.field_4 = ((v48 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 sr.field_0 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 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
11486 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 v39 -= pOutdoorCamera->int_fov_rad_inv << v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 if ( !v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 v50 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 v75 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 v51 = v50 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 v79 = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 LODWORD(v51) = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 v52 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 v74 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 if ( (int)v51 + v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 v75 = abs(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 v53 = abs(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 if ( v75 <= v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 LODWORD(v54) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 HIDWORD(v54) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 v76 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 v55 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 HIWORD(v56) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 if ( v72 <= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 HIWORD(v56) = HIWORD(v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 LOWORD(v56) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 sr.field_24 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 v57 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 v58 = ((unsigned __int64)(v75 * (signed __int64)v55) >> 16) - v57->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 v75 = v57->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 v59 = (((v76 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 sr.field_4 = ((v58 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 sr.field_0 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 sr.field_28 = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 // 6BE050: using guessed type int texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 // 6BE054: using guessed type int texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 // 6BE0F0: using guessed type int mipmapping_terrain_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 // 6BE0F4: using guessed type int mipmapping_terrain_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 // 6BE0F8: using guessed type int mipmapping_terrain_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 // 80AA10: using guessed type char byte_80AA10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 //----- (00485407) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 signed int __fastcall sr_sub_485407_prolly_odm_water_wavy(Span *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 unsigned int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 int v8; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 stru149 *v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 stru149 *v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 signed int v15; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 int v16; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 int v18; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 unsigned __int8 *pLOD; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 Texture *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 Texture *v23; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 stru149 *v25; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 signed int v27; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 stru149 *v28; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 Texture *v29; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 signed int v30; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 signed int v31; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 signed int v32; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 int v34; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 int v35; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 unsigned __int64 v36; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 int v37; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 unsigned __int64 v38; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 char v39; // cl@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 stru316 a2; // [sp+Ch] [bp-90h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 stru315 a1a; // [sp+34h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 Span *v43; // [sp+78h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 int v44; // [sp+7Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 int v45; // [sp+80h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 int v46; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 Span *v47; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 int v48; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 int v49; // [sp+90h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 int i; // [sp+94h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 int X; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 v2 = a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 v3 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 v4 = v3 + pRenderer->uTargetSurfacePitch * a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 v5 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 v43 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 v6 = a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 a1a.pColorBuffer = &pRenderer->pTargetSurface[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 v46 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 a1a.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 v9 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 v47 = (Span *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 v48 = v9->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 v10 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 v11 = X + v10->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 v48 = v10->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 v12 = ((unsigned __int64)(v48 * (signed __int64)v8) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 v45 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 v48 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 v13 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 v14 = X + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 v15 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 v48 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 X = ((unsigned __int64)(v7 * (signed __int64)v13) >> 16) + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 if ( !X || (v16 = abs(v15 >> 14), v16 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 LODWORD(v17) = v48 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 HIDWORD(v17) = v48 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 i = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 v18 = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 HIWORD(v19) = (unsigned int)(v17 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 a1a.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 pLOD = v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 a1a.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 if ( v18 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 if ( v18 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 if ( v18 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 v49 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 pLOD = v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 pLOD = v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 pLOD = v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 v21 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 pLOD = v21->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 a1a.pTextureLOD = (unsigned __int16 *)pLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 if ( !pLOD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 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
11693 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 v43 = (Span *)(v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 v25 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 v48 = v46 - 16 * (v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 v46 = v25->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 v46 = v44 + ((unsigned __int64)(v46 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 v44 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 v45 += (unsigned __int64)(v44 * (signed __int64)v7) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 X = (unsigned __int64)(v46 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 X = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 v27 = ((unsigned __int64)(v46 * (signed __int64)v18) >> 16) - v26->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 X = (unsigned __int64)(v45 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 v28 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 v44 = bUseLoResSprites + v49 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 v30 = v27 >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 v31 = (signed int)(((unsigned __int64)(v45 * (signed __int64)v18) >> 16) - v28->field_28) >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 v32 = (signed int)v29->uTextureWidth >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 v33 = (signed int)v29->uTextureHeight >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 v34 = v49 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 a1a.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 X = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 v45 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 a1a.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 a1a.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 i = (unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 v47 = (Span *)(i >> v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 v36 = (signed int)v47 * (signed __int64)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 i = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 a1a.field_4 = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 v37 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 v38 = (signed int)v47 * (signed __int64)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 i = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 a1a.field_0 = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 if ( (signed int)v43 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 v47 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 v39 = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 for ( i = 12 - v49; ; v39 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> v39));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 v30 += 16 * a1a.field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 v31 += 16 * a1a.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 v47 = (Span *)((char *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 i = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> (12 - v49)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 a1a.field_28 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 //----- (0048585C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 signed int __fastcall sr_sub_48585C_mb_DrawSpan(Span *a1, unsigned __int16 *pRenderTarget, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 Span *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 stru148 *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 signed __int64 v6; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 signed int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 void *v9; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 int v10; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 unsigned __int16 *pPixels; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 signed int v13; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 int X; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 pPixels = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 v4 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 v13 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 X = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 * (pViewport->uScreenCenterX - (signed int)a1->field_8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 * (signed __int64)v4->v_18.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 + ((unsigned __int64)(v4->v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 * (pViewport->uScreenCenterY - (signed int)a1->field_A))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 if ( X && (v5 = abs(-v4->field_24 >> 14), v5 <= abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 LODWORD(v6) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 HIDWORD(v6) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 v7 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 v8 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 v7 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 v8 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 v9 = sr_sub_47C178(v8, v4, pOutdoorCamera->terrain_gamma, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 fill_pixels_fast(*((short *)v9 + v4->pTexture->uDecompressedSize), pPixels, v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 HIWORD(v10) = HIWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 LOWORD(v10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 j_memset32(v10, &pRenderer->pActiveZBuffer[v3->field_8 + 640 * v3->field_A], v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 //----- (00485975) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 stru315 *__fastcall sr_sub_485975(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 v11 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 //----- (00485A24) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 stru315 *__fastcall sr_sub_485A24(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11900 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11903 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 v14 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 //----- (00485AFF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 stru315 *__fastcall sr_sub_485AFF(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 v7 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 v11 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 //----- (00485BAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 stru315 *__fastcall sr_sub_485BAE(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 v10 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 v14 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 //----- (00485C89) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 stru315 *__fastcall sr_sub_485C89(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 int v7; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 int v8; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 unsigned __int16 *v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 unsigned int *v11; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 int v12; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 int v13; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 v13 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 if ( *((char *)result->pTextureLOD + v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 if ( a2->field_8 - v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132 v9 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 v10 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 v6 = v13 + (v9 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 v10 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 *result->pColorBuffer = v10[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 v11 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144 v12 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 //----- (00485D3E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157 stru315 *__fastcall sr_sub_485D3E(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 int v10; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 int v11; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 int v12; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 unsigned __int16 *v13; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 unsigned int *v14; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172 int v15; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 int v16; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193 v16 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 if ( *((char *)result->pTextureLOD + v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 if ( a2->field_8 - v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 v12 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 v13 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 v9 = v16 + (v12 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 v13 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 *result->pColorBuffer = v13[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 v14 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 v15 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 *v14 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 //----- (00485E1F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 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
12236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 stru316 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 signed int *v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 signed int *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 char v10; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 Span *v12; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 double v13; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 double v14; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 int v15; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 signed int v16; // ST14_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 char v17; // dl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 signed int v18; // ST10_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 void *v19; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 signed int v20; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 char v21; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 int v22; // ST10_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 signed int v23; // ST14_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 char v24; // dl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 Span *v26; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 char v27; // [sp+16h] [bp-2h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 char v28; // [sp+17h] [bp-1h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 float v29; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 float v30; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 v7 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v8 = &a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 v9 = &a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 v10 = a1->field_0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 v27 = a1->field_4 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 v28 = !v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 sr_sub_47BEB1(a3, a4, a5, 0, &a1->field_8, &a1->field_C, (int)&v27, (int)&v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 v7->field_24_palette = (unsigned __int16 *)sr_sub_47C28C_get_palette(a4, v28, *v9, *v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 v11 = a4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 v7->field_20 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 if ( a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 v12 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 v29 = v26->field_10 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 v13 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 v7->field_10 = LODWORD(v13) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 v30 = v12->field_14 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 v14 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 v15 = v7->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 v7->field_14 = LODWORD(v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 v7->field_18 = -((v15 - (LODWORD(v14) << 16)) / v12->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 v16 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 v17 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 v18 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 v7->field_1C = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 v19 = sr_sub_47C28C_get_palette(a4, v17, v18, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 v20 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 v21 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 v7->field_10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 v7->field_14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 v22 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 v7->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 v7->field_1C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 v19 = sr_sub_47C1CA(a4, v21, v22, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 v23 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 v7->field_24_palette = (unsigned __int16 *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 return sr_sub_47C1CA(a4, v24, *v9, v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 //----- (00485F53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 void __thiscall sub_485F53(Vec2_int_ *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 ++v->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 if ( v->y > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 v->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 //----- (00485F64) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 void OutdoorCamera::_485F64()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 signed __int64 v3; // qtt@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 this->uCameraFovInDegrees = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 v1 = stru_5C6E00->uPiMask & 0xD5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 if ( v1 >= (signed int)stru_5C6E00->uIntegerHalfPi )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 v2 = -stru_5C6E00->pTanTable[stru_5C6E00->uIntegerPi - v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 v2 = stru_5C6E00->pTanTable[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 LODWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 HIDWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 v4 = (signed int)(v3 / v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 this->int_fov_rad = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 this->field_4C = 360000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 this->int_fov_rad_inv = 65536 / v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 this->field_50 = 115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 unnamed_6BE060[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 //----- (0048600E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 void OutdoorCamera::RotationToInts()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 camera_rotation_y_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 camera_rotation_y_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 camera_rotation_x_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 camera_rotation_x_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 //----- (0048607B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 void stru148::_48607B(stru149 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 this->pTexture = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 this->ptr_38 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 //----- (00486089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 void stru148::_486089_normalize_v_18()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 stru148 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 double v3; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 float v4; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 double v5; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 float v6; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 double v7; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 float v8; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 float v9; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 double v10; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 float v11; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 double v12; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 float v13; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 double v14; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 float v15; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 v2 = (double)this->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 v3 = (double)this->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 v5 = (double)this->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 v7 = sqrt(v5 * v5 + v3 * v3 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 v1->v_18.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 v1->v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 v1->v_18.z = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 v8 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 v9 = v8 * v15 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 v1->v_18.x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 v11 = v8 * v4 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 v1->v_18.y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 v13 = v8 * v6 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 v1->v_18.z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 //----- (0048616B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 int stru149::_48616B(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 int v8; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 int v13; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 int v14; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 int v15; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 int v16; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 int v17; // ST0C_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 int v18; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 int v19; // ST0C_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 int v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 int v21; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 int v24; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 int v25; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 int v26; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 int v27; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 int v28; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 int v29; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 v25 = pOutdoorCamera->camera_rotation_x_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 v7 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 v27 = pOutdoorCamera->camera_rotation_x_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 v8 = -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 v9 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 v26 = -pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 v24 = -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 v10 = pOutdoorCamera->camera_rotation_y_int_cosine * -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 v11 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 v14 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 v15 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 this->field_0 = ((unsigned __int64)(v11 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 + ((unsigned __int64)(-65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 * pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 this->field_4 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 v13 = ((unsigned __int64)((v26 << 16) * (signed __int64)v25) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 - ((unsigned __int64)(v14 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 this->field_4 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 this->field_0 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 v13 = v26 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 this->field_8 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 v17 = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 this->field_C = ((unsigned __int64)(v17 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 + ((unsigned __int64)(a4 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 v16 = ((unsigned __int64)(a4 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v17 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 this->field_C = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 v16 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 this->field_14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 v19 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 this->field_18 = ((unsigned __int64)(v19 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 + ((unsigned __int64)(a7 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 v18 = ((unsigned __int64)(a7 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 this->field_18 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 v18 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 this->field_20 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 v20 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 v21 = ((unsigned __int64)(v20 * (signed __int64)this->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 v28 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 v22 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 this->field_24 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 v29 = (unsigned __int64)(v28 * (signed __int64)v22) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 this->field_28 = v29 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 //----- (0048653D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 int stru149::_48653D(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 stru149 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 int v13; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 int v14; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 int v15; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 int v16; // ST14_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 int v17; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 int v18; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 int v19; // ST10_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 int v20; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 int v21; // ST10_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 int v23; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 int v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 int v26; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 int v27; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 int v28; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 int v29; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 int v30; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 int v31; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 v8 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 v29 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 v28 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 v11 = -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 v26 = -pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 v27 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 v12 = -pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 v16 = v8 * -pBLVRenderParams->vPartyPos.x + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 v17 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 v7->field_0 = ((unsigned __int64)(v16 * (signed __int64)v28) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 v15 = ((unsigned __int64)(v17 * (signed __int64)v28) >> 16) - ((unsigned __int64)(v16 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 v7->field_0 = v10 + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 v15 = v12 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 v7->field_8 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 v19 = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 v7->field_C = ((unsigned __int64)(v19 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 + ((unsigned __int64)(a4 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 v18 = ((unsigned __int64)(a4 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 v7->field_C = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 v18 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 v7->field_14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 v21 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 v7->field_18 = ((unsigned __int64)(v21 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 + ((unsigned __int64)(a7 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 v20 = ((unsigned __int64)(a7 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v21 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 v7->field_18 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 v20 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 v7->field_18 = -v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 v7->field_1C = -v7->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 v7->field_20 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 v22 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 v7->field_20 = -v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 v23 = ((unsigned __int64)(v22 * (signed __int64)v7->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 + ((unsigned __int64)(v7->field_10 * (signed __int64)v7->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 + ((unsigned __int64)(v7->field_14 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 v30 = v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 v24 = v7->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 v7->field_24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 v31 = (unsigned __int64)(v30 * (signed __int64)v24) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 result = (unsigned __int64)(v7->field_1C * (signed __int64)v7->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 v7->field_28 = v31 + result + ((unsigned __int64)(v7->field_20 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 //----- (0048694B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 int stru149::_48694B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 int v2; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 int v3; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 int v5; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 v1 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 v2 = (unsigned __int64)(v1 * (signed __int64)this->field_0) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 v3 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 v4 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 this->field_24 = v2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 v5 = (unsigned __int64)(v3 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 this->field_28 = v5 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 //----- (00486A28) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 void OutdoorCamera::AllocSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 if ( !this || !pSpans )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 ReleaseSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 pSpans = (Span *)pAllocator->AllocNamedChunk(pSpans, 0x493E0u, "SPANS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 pEdges = (Edge *)pAllocator->AllocNamedChunk(pEdges, 0x4C2C0u, "EDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 pSurfs = (Surf *)pAllocator->AllocNamedChunk(pSurfs, 0x11940u, "SURFS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 pNewEdges = (Edge *)pAllocator->AllocNamedChunk(pNewEdges, 0x6180u, "NEWEDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 memset(pSpans, 0, 0x493E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 memset(pEdges, 0, 0x4C2C0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 memset(pSurfs, 0, 0x11940u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 memset(pNewEdges, 0, 0x6180u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 //----- (00486AFC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 void OutdoorCamera::ReleaseSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 pAllocator->FreeChunk(pSpans);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 pAllocator->FreeChunk(pEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 pAllocator->FreeChunk(pSurfs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 pAllocator->FreeChunk(pNewEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 pSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 pEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 pSurfs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 pNewEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 //----- (00486B4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 char __fastcall sr_sub_486B4E_push_outdoor_edges(RenderVertexSoft *a1, int *a2, int *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 RenderVertexSoft *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 char v6; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 int *v9; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 int v10; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 int v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 double v12; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 int *v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 double v14; // st6@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 double v15; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 int v16; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 double v17; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 double v18; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 int v19; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 double v20; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 double v21; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 Edge *i; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 double v23; // st7@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 Edge *v24; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 std::string v26; // [sp-18h] [bp-98h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 const char *v27; // [sp-8h] [bp-88h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 int v28; // [sp-4h] [bp-84h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 double v29; // [sp+Ch] [bp-74h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 double v30; // [sp+14h] [bp-6Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 double v31; // [sp+1Ch] [bp-64h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 double v32; // [sp+24h] [bp-5Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 double v33; // [sp+2Ch] [bp-54h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 unsigned int v34; // [sp+34h] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 unsigned __int64 v35; // [sp+38h] [bp-48h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 int v36; // [sp+40h] [bp-40h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 int v37; // [sp+44h] [bp-3Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 float v38; // [sp+48h] [bp-38h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 int v39; // [sp+4Ch] [bp-34h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 int v40; // [sp+50h] [bp-30h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 int v41; // [sp+54h] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 RenderVertexSoft *v42; // [sp+58h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 int v43; // [sp+5Ch] [bp-24h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 int v44; // [sp+60h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 int v45; // [sp+64h] [bp-1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 unsigned int v46; // [sp+68h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 int *v47; // [sp+6Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 int v48; // [sp+70h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 float *v49; // [sp+74h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 float v50; // [sp+78h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 float v51; // [sp+7Ch] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 v47 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 v6 = (HIBYTE(a4->flags) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 v42 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 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
12744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 LOBYTE(v7) = v4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 v8 = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 v4->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 BYTE3(a4) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 if ( (signed int)pOutdoorCamera->uNumSurfs < 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 v7 = pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 if ( (signed int)pOutdoorCamera->uNumEdges < 5979 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 v4->uEdgeList1Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 v4->uEdgeList2Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 v45 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 v34 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 v28 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 v27 = (const char *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 v44 = 10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 pGame->pLightmapBuilder->_45CB89(v5, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 v9 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 v49 = &v5->flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 v46 = (char *)v47 - (char *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 v10 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 ++pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 if ( v48 >= v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 v11 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 LODWORD(v50) = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 if ( SLODWORD(v50) > v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 v45 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 if ( v11 < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 v12 = (double)SLODWORD(v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 v13 = &a3[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 v51 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 v14 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 v50 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 *(float *)&v40 = v14 - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 v33 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 v43 = LODWORD(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 if ( LODWORD(v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 if ( SLODWORD(v33) >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 v19 = (int)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 ptr_80C978_Edges->field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 LODWORD(v38) = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 v40 = *(unsigned int *)LODWORD(v38) - *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 v20 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 v40 = *v13 - *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 v21 = v20 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 ptr_80C978_Edges->field_4 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 ptr_80C978_Edges->field_0 = (v51 - (double)*v9) * v21 + (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 ptr_80C978_Edges->field_1C = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 ptr_80C978_Edges->field_20 = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 ptr_80C978_Edges->field_24 = (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 ptr_80C978_Edges->field_28 = (double)(signed int)*(unsigned int *)LODWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 ptr_80C978_Edges->field_2C = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 ptr_80C978_Edges->field_30 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 v4->pEdgeList1[v4->uEdgeList1Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 v32 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 v39 = LODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 v51 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 v15 = (double)SLODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 ptr_80C978_Edges->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 v16 = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 v50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 v40 = *(int *)((char *)v9 + v46) - *(int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 v17 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 v40 = *v9 - *v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 v18 = v17 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 ptr_80C978_Edges->field_4 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 ptr_80C978_Edges->field_0 = (v51 - (double)*v13) * v18 + (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 ptr_80C978_Edges->field_1C = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 ptr_80C978_Edges->field_20 = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 ptr_80C978_Edges->field_24 = (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 ptr_80C978_Edges->field_28 = (double)*(int *)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 ptr_80C978_Edges->field_2C = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 ptr_80C978_Edges->field_30 = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 v4->pEdgeList2[v4->uEdgeList2Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 v31 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 v37 = LODWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 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
12846 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 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
12848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 ptr_80C978_Edges->pNext = i->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 i->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 ptr_80C978_Edges->pNext = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 i->pPrev->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 v23 = v50 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 *(float *)&v40 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 v38 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 v30 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 v36 = LODWORD(v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 ptr_80C978_Edges->ptr_18 = ptr_80CA10[LODWORD(v30)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 v29 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 v35 = __PAIR__(v40, LODWORD(v29));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 v24 = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 ptr_80CA10[LODWORD(v29)] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 v24->pSurf = ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 if ( ptr_80C978_Edges < &pEdges[5999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 ++ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 v49 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 while ( v48 - 1 < v41 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 LOBYTE(v7) = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 if ( pOutdoorCamera->uNumEdges != v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 v4->ptr_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 ptr_80C97C_Surfs->field_22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 ptr_80C97C_Surfs->pParent = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883 ptr_80C97C_Surfs->field_4 = v4->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 ptr_80C97C_Surfs->field_8 = v4->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 ptr_80C97C_Surfs->field_0 = v4->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886 ptr_80C97C_Surfs->field_C = v4->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887 ptr_80C97C_Surfs->field_10 = v4->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 LOBYTE(v7) = (char)pSurfs + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12889 if ( ptr_80C97C_Surfs < &pSurfs[1999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12891 ++ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12892 ++pOutdoorCamera->uNumSurfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12894 if ( BYTE3(a4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12895 v4->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 //----- (0043F953) --------------------------------------------------------
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
12906 void PrepareWallsRenderList_BLV()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 pStru170->uNumFaceIDs = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12909 if ( pBLVRenderParams->uPartySectorID )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12910 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12911 pStru170->field_FA8[0].uSectorID = pBLVRenderParams->uPartySectorID;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12912 pStru170->field_FA8[0].uViewportW = pBLVRenderParams->uViewportW;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12913 pStru170->field_FA8[0].uViewportZ = pBLVRenderParams->uViewportZ;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12914 pStru170->field_FA8[0].uViewportY = pBLVRenderParams->uViewportY;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12915 pStru170->field_FA8[0].uViewportX = pBLVRenderParams->uViewportX;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 pStru170->field_FA8[0].field_C._43F9E1(
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12917 pBLVRenderParams->uViewportX,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12918 pBLVRenderParams->uViewportY,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12919 pBLVRenderParams->uViewportZ,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12920 pBLVRenderParams->uViewportW);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 pStru170->field_FA8[0].uFaceID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922 pStru170->field_FA8[0].std__vector_0007A8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 pStru170->std__vector_000FA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 sub_440639(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 }
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
12926 pStru170->MakeVisibleSectorList();
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 //----- (0043F9E1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 __int16 *stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 signed int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 __int16 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 auto a2 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 auto a3 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 auto a4 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 auto a5 = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 this->_viewport_space_y = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 this->field_4 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 result = this->array_3D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 if ( v5 < a3 || v5 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 *result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 *(result - 480) = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 *(result - 480) = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 *result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 while ( v5 < 480 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 //----- (0043FA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 LevelDecoration *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 DecorationDesc *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 __int16 v4; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 unsigned int v8; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 int v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 SpriteFrame *v11; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 SpriteFrame *v12; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 RenderBillboard *v15; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 char v16; // zf@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 IndoorCameraD3D **v17; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 double v18; // st7@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 float v19; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 signed __int64 v20; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 signed __int64 v21; // qtt@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 int v23; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 Particle_ local_0; // [sp+Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 double v25; // [sp+74h] [bp-38h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 unsigned int v26; // [sp+7Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 int a2; // [sp+80h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 int a3; // [sp+84h] [bp-28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 int a1; // [sp+88h] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 int v30; // [sp+8Ch] [bp-20h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 float v31; // [sp+90h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 int a5; // [sp+94h] [bp-18h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 int z; // [sp+98h] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 int a6; // [sp+9Ch] [bp-10h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 int y; // [sp+A0h] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 int x; // [sp+A4h] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 int v37; // [sp+A8h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 v26 = uDecorationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 LODWORD(v31) = uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 v2 = &pLevelDecorations[uDecorationID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 if ( !(v2->field_2 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 v4 = v3->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 if ( (char)v4 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 if ( !(v4 & DECORATION_DONT_DRAW) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 v6 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 v7 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 a2 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 a1 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 a3 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 v8 = v2->field_10_y_rot
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 + ((signed int)stru_5C6E00->uIntegerPi >> 3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 v37 = pBLVRenderParams->field_0_timer_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 v37 = pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 v10 = abs(v2->vPosition.x + v2->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 v13 = v11->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 if ( v13 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 v30 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 if ( v13 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 if ( v13 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 LOBYTE(v30) = v30 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 if ( (256 << v9) & v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1, a2, a3, &x, &y, &z, 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 v14 = abs(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 if ( v14 >= abs(y) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 v15 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 if ( (signed int)uNumBillboardsToDraw < 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 ++uNumDecorationsDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 v16 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051 v15->uHwSpriteID = v12->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 v15->uPalette = v12->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 v15->uIndoorSectorID = LOWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 LODWORD(v21) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v21 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 v17 = &pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 v15->flt_8 = pGame->pIndoorCameraD3D->flt_D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 v18 = (*v17)->flt_D4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 v19 = v15->flt_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 v15->flt_C = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 v31 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 v25 = v19 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 v31 = v15->flt_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 v25 = v31 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 HIWORD(v22) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 v15->field_4 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 v15->field_1E = v30;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13089 v15->some_x = a1;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13090 v15->some_y = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13091 v15->some_z = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13092 v15->uScreenSpaceX = a5;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13093 v15->uScreenSpaceY = a6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 v23 = 8 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 LOBYTE(v23) = 8 * v26 | 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13096 LOWORD(v22) = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13097 v15->uTintColor = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 v15->sZValue = v22 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 v15->pSpriteFrame = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 v5 = (double)v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 local_0.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 local_0.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 local_0.x = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 local_0.y = (double)v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 local_0.z = (double)v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 local_0.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 local_0.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 local_0.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 local_0.flt_28 = 1.0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13118 local_0.timeToLive = (rand() & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 pGame->pParticleEngine->AddParticle(&local_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 //----- (0044028F) --------------------------------------------------------
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13127 void PrepareItemsRenderList_BLV()
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13128 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 ObjectDesc *v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 __int16 v2; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 RenderBillboard *v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 SpriteFrame *v4; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13133 SpriteFrame *v5; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 int v7; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 int v8; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 int v9; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 unsigned __int16 v10; // ax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 int *v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 char v12; // zf@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 int v18; // ST5C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 signed __int64 v19; // qtt@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143 int v20; // ST5C_4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144 int v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 __int16 v22; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146 int v23; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 __int16 a5; // [sp+28h] [bp-34h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 int a6; // [sp+2Ch] [bp-30h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150 int a2; // [sp+30h] [bp-2Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 int a1; // [sp+34h] [bp-28h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 int v30; // [sp+38h] [bp-24h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 int v31; // [sp+38h] [bp-24h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 int a3; // [sp+40h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 signed __int16 v34; // [sp+44h] [bp-18h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 int v35; // [sp+48h] [bp-14h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157 int v36; // [sp+4Ch] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 signed int z; // [sp+50h] [bp-Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159 signed int y; // [sp+54h] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 signed int x; // [sp+58h] [bp-4h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13162 for (uint i = 0; i < uNumLayingItems; ++i)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13163 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13164 auto p = pLayingItems + i;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13165 if (p->uObjectDescID)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13166 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13167 v1 = &pObjectList->pObjects[p->uObjectDescID];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 if ( !(v1->uFlags & 1) )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13169 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13170 if ( ((v2 = p->uItemType, v2 < 1000) || v2 >= 10000)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 && (v2 < 500 || v2 >= 600)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 && (v2 < 811 || v2 >= 815)
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13173 || pGame->pStru6Instance->_4A81CA(p))
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13174 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13175 a5 = p->uSectorID;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13176 a1 = p->vPosition.x;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13177 a2 = p->vPosition.y;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13178 a3 = p->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 v3 = &pBillboardRenderList[uNumBillboardsToDraw];
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13180 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, p->uSpriteFrameID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 v24 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 v30 = v4->uFlags;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13184 a6 = v4->uGlowRadius * p->field_22;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185 v6 = stru_5C6E00->Atan2(
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13186 p->vPosition.x - pBLVRenderParams->vPartyPos.x,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13187 p->vPosition.y - pBLVRenderParams->vPartyPos.y);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13188 LOWORD(v7) = p->uFacing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 v10 = v5->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 v3->uHwSpriteID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 if ( v30 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 a3 -= (signed int)((unsigned __int64)(v5->scale
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 if ( v8 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 v34 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 if ( v8 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13203 v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 if ( v8 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 LOBYTE(v34) = v34 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 v11 = (int *)(256 << v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 if ( (256 << v9) & v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 v34 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 if ( a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 LOBYTE(v11) = byte_4E94D3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 pMobileLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 a6,
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13218 v1->uParticleTrailColorR,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13219 v1->uParticleTrailColorG,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13220 v1->uParticleTrailColorB,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 &x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 &y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 &z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 if ( (signed int)uNumBillboardsToDraw >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 ++uNumSpritesDrawnThisFrame;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13237 p->uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 v12 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 v3->uPalette = v24->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 v3->uIndoorSectorID = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13243 LODWORD(v19) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 HIDWORD(v19) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 v20 = v19 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 v3->field_0 = (unsigned __int64)(v24->scale * v19 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13251 v3->flt_8 = pGame->pIndoorCameraD3D->flt_D0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13252 v3->flt_C = pGame->pIndoorCameraD3D->flt_D4;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13253 v18 = (int)floorf(v3->flt_8 + 0.5f) / x;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13254 v3->field_0 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13255 v31 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 HIWORD(v21) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 v3->field_4 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 v3->field_1E = v34;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13260 v3->some_x = a1;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13261 v3->some_y = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13262 v3->some_z = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13263 v3->uScreenSpaceX = v36;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 v22 = v35;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13265 v3->uTintColor = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13266 v3->uScreenSpaceY = v22;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 LOWORD(v21) = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13268 v23 = 8 * i;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13269 LOBYTE(v23) = 8 * i | 2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 v3->pSpriteFrame = v24;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13271 v12 = (p->uAttributes & 0x20) == 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 v3->sZValue = v21 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 v3->sZValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287 //----- (00440639) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 void __fastcall sub_440639(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 BLVSector *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 v3 = &pIndoor->pSectors[pStru170->field_FA8[a1].uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 do
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13302 {
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13303 Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13304 pStru170->PrepareFaceRenderList_d3d(v1, v3->pFaceIDs[v2++]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13305 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 do
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13314 pStru170->PrepareFaceRenderList_sw(v1, v3->pFaceIDs[v2++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 if ( v3->field_0 & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 sub_4406BC(v1, v3->uFirstBSPNode);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 //----- (004406BC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 void __fastcall sub_4406BC(int a1, unsigned int uFirstNode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 BLVSector *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 BSPNode *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 BLVFace *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 __int16 v6; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 int v7; // ebp@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 int v8; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 __int16 v9; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 int v10; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 bool v11; // [sp+14h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13337 Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13338
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 v10 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 v12 = &pStru170->field_FA8[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 v2 = &pIndoor->pSectors[v12->uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 v3 = &pIndoor->pNodes[uFirstNode];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 v4 = &pIndoor->pFaces[v2->pFaceIDs[v3->uCoplanarOffset]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346 v5 = v4->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 + pBLVRenderParams->vPartyPos.x * v4->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 + pBLVRenderParams->vPartyPos.y * v4->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 + pBLVRenderParams->vPartyPos.z * v4->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 if ( v4->uAttributes & 1 && v4->uSectorID != v12->uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 v5 = -v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 v11 = v5 > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 if ( v5 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 v6 = v3->uFront;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 v6 = v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 sub_4406BC(v10, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 v7 = v3->uCoplanarOffset;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 v8 = v7 + v3->uCoplanarSize;
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13361
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13362 Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13363
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 while ( v7 < v8 )
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13367 pStru170->PrepareFaceRenderList_d3d(v10, v2->pFaceIDs[v7++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 while ( v7 < v8 )
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13372 pStru170->PrepareFaceRenderList_sw(v10, v2->pFaceIDs[v7++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 v9 = v11 ? v3->uFront : v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 if ( v9 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 uFirstNode = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 //----- (00440DF5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 int stru167_wrap::Push(__int16 a2, __int16 a3, __int16 a4, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13386 pElements[uNumElements].field_6_rnd_value = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13387 pElements[uNumElements].field_8_rnd_value = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13388 pElements[uNumElements].field_A_rnd_value = a4;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13389 pElements[uNumElements].field_C_time_left = rand() % 64 + 256;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13390 pElements[uNumElements].field_E_time_to_live = pElements[uNumElements].field_C_time_left;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13391 result = 3 * uNumElements;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13392 pElements[uNumElements++].bgr16 = bgr;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13393 if (uNumElements >= 100 )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13394 uNumElements = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13395 return result;
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 //----- (00440E91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 void stru167_wrap::_440E91(__int16 x, int y, int z, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 stru167_wrap *v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 int i; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 int v8; // ST08_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 int v9; // ST04_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 int v10; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 for ( i = 0; i < rand() % 6 + 5; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 v8 = z + rand() % 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 v9 = rand() % 33 + y - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 Push(v10 % 33 + x - 16, v9, v8, a5, bgr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 //----- (00440F07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 void stru167_wrap::_440F07()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13420 for (uint i = 0; i < 100; ++i)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13421 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13422 if (pElements[i].field_C_time_left > 0)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13423 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13424 pElements[i].field_A_rnd_value += rand() % 5 + 4;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13425 pElements[i].field_6_rnd_value += rand() % 5 - 2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13426 pElements[i].field_8_rnd_value += rand() % 5 - 2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13427 pElements[i].field_C_time_left -= (short)pEventTimer->uTimeElapsed;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13428 }
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13429 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 //----- (0044100D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 bool __cdecl sub_44100D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13435 return pCurrentScreen == 4
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13436 || pCurrentScreen == 7
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13437 || pCurrentScreen > 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13438 && (pCurrentScreen <= 14
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13439 || pCurrentScreen > 16
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13440 && (pCurrentScreen <= 18
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13441 || pCurrentScreen == 23));
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13442 }
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13443 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 //----- (00441498) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 void __cdecl GameUI_DrawTorchlightAndWizardEye()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 unsigned int v0; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 IconFrame *v1; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 unsigned int v2; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 IconFrame *v3; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13453 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13454 || pCurrentScreen == 1
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13455 || pCurrentScreen == 2
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13456 || pCurrentScreen == 5
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13457 || pCurrentScreen == 8
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13458 || pCurrentScreen == 10
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13459 || pCurrentScreen == 11
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13460 || pCurrentScreen == 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13461 || pCurrentScreen == 15
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13462 || pCurrentScreen == 3
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13463 || pCurrentScreen == 19 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 v0 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471 pUIAnum_Torchlight->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 pUIAnum_Torchlight->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 &pIcons_LOD->pTextures[v1->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478 v2 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13481 pUIAnim_WizardEye->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482 pUIAnim_WizardEye->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 &pIcons_LOD->pTextures[v3->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13487 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 //----- (0044158F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 void __cdecl GameUI_DrawCharacterSelectionFrame()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 pRenderer->DrawTextureTransparent(
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13494 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 0x17Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 &pIcons_LOD->pTextures[dword_50C98C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 }
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13498
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 //----- (004415C5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 void __cdecl Load_isn_spells_21_27()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 char pContainer[120]; // [sp+8h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509 sprintf(pContainer, "isn-%02d", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510 pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512 while ( v0 < 14 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513 uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514 uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517 //----- (0044162D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518 void __cdecl GameUI_DrawPartySpells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 unsigned int v0; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 int v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 __int16 *v4; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 Player *v5; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 unsigned int v6; // [sp-4h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 Texture *v7; // [sp-4h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13528 unsigned int v8; // [sp-4h] [bp-1Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 Texture *v9; // [sp-4h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 Player **v10; // [sp+10h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 v2 = (unsigned __int8)byte_4E5DD8[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 v3 = pTextureIDs_isns[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 pRenderer->_4A65CC(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 pPartySpellbuffsUI_XYs[v1][0],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 pPartySpellbuffsUI_XYs[v1][1],
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13544 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13545 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 v0 + 20 * pPartySpellbuffsUI_smthns[v1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548 63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 while ( v1 < 14 );
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13553 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13554 || pCurrentScreen == 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564 pRenderer->DrawTextureIndexed(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 pRenderer->DrawTextureTransparent(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 if ( pParty->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 v8 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 pRenderer->DrawTextureIndexed(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 pRenderer->DrawTextureTransparent(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13582
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13583 uint _it = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 v10 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 v5 = *v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 0x1ABu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13593 (Texture *)(dword_507964 != -1 ? &pIcons_LOD->pTextures[dword_507964] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 0x189u,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13598 (Texture *)(dword_50796C != -1 ? &pIcons_LOD->pTextures[dword_50796C] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 0x19Au,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13603 (Texture *)(dword_507968 != -1 ? &pIcons_LOD->pTextures[dword_507968] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 0x1BCu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13608 (Texture *)(dword_507960 != -1 ? &pIcons_LOD->pTextures[dword_507960] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13612 //while ( (signed int)v4 < (signed int)pBaseHealthByClass );
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13613 while (++_it != 4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 //----- (00441A4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 __int16 __fastcall sub_441A4E(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 __int16 result; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 char *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 int v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 SpriteFrame *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 SpriteFrame *v7; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628 unsigned __int16 v9; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 RenderBillboardTransform_local0 v10; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 int v11; // [sp+5Ch] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631 int v12; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 int v13; // [sp+64h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 v10.uParentBillboardID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 v10.pTarget = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 v10.pTargetZ = pRenderer->pActiveZBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 v10.uTargetPitch = pRenderer->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 v10.uViewportX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 v10.uViewportY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 v10.uViewportZ = 639;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 v10.uViewportW = 479;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 v3 = (char *)&pOtherOverlayList->pOverlays[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 if ( *((short *)v3 - 3) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 result = *((short *)v3 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 if ( result >= 300 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 v4 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 v5 = result == v2 + 320 | result == v2 + 330 | result == v2 + 340 | result == v2 + 350;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 result = v2 + 310;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 if ( v4 == v2 + 310 | v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 if ( !*(short *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 v6 = pSpriteFrameTable->GetFrame(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 pOverlayList->pOverlays[*((short *)v3 - 5)].uSpriteFramesetID,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 *((short *)v3 - 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13664 v11 = *((int *)v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 v13 = v6->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 v13 = (unsigned __int64)(v11 * (signed __int64)v13) >> 16;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13667 v10.uScreenSpaceX = *((short *)v3 - 2);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13668 v10.uScreenSpaceY = *((short *)v3 - 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 v10.field_10 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 v10.field_14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v6->uPaletteIndex, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 v8 = *((short *)v3 - 5);
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13673 v10.sZValue = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 v10.uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 v9 = pOverlayList->pOverlays[v8].uOverlayType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 if ( !v9 || v9 == 2 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13677 v10.uScreenSpaceY += pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]].uHeight >> 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 result = pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]]._4AD2D1(&v10, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 if ( v12 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 v3 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 //----- (00441D38) --------------------------------------------------------
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13695 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
13696 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13697 int uHeight; // ebx@6
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13698 //unsigned int v9; // edx@9
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13699 //unsigned int v10; // ebx@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 __int16 v11; // cx@11
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13701 //BLVFace *v12; // ecx@17
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13702 //unsigned int v13; // ecx@21
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 unsigned int v14; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 int v15; // eax@23
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13705 //unsigned int *v16; // ecx@28
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 __int16 v17; // di@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 double v18; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 float v19; // ST38_4@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 double v20; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 double v21; // st6@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 double v22; // st5@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 unsigned __int16 *v26; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 signed int v27; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714 unsigned __int16 *v28; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 signed int v29; // edi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 int v30; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 unsigned __int16 *v31; // ebx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 signed int v32; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 signed int v33; // ebx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 unsigned int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 signed int v35; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 unsigned __int16 v36; // di@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 int v37; // edi@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 int v38; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 __int16 v39; // ax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 int v40; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 int v41; // ebx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 unsigned int v42; // eax@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 unsigned int v43; // ebx@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 unsigned int v44; // ST30_4@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 char *v45; // ebx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 int v46; // edi@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 int v47; // eax@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 unsigned int v48; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 unsigned int v49; // ST64_4@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 double v50; // ST20_8@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 unsigned int v51; // [sp-10h] [bp-64h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 unsigned int v52; // [sp-10h] [bp-64h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 unsigned int v53; // [sp-Ch] [bp-60h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 unsigned int v54; // [sp-Ch] [bp-60h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 unsigned int v55; // [sp-8h] [bp-5Ch]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 unsigned int v56; // [sp-8h] [bp-5Ch]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 signed int v57; // [sp-4h] [bp-58h]@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 unsigned __int16 v58; // [sp-4h] [bp-58h]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 unsigned __int16 v59; // [sp-4h] [bp-58h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 unsigned __int16 v60; // [sp+10h] [bp-44h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 unsigned int v61; // [sp+10h] [bp-44h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 unsigned __int16 *v62; // [sp+14h] [bp-40h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 unsigned int v63; // [sp+14h] [bp-40h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 int v64; // [sp+18h] [bp-3Ch]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 unsigned int v65; // [sp+18h] [bp-3Ch]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752 unsigned int lPitch; // [sp+20h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 unsigned int lPitcha; // [sp+20h] [bp-34h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 char *lPitchb; // [sp+20h] [bp-34h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 unsigned int v69; // [sp+24h] [bp-30h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 signed int v70; // [sp+24h] [bp-30h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 signed int uBluea; // [sp+28h] [bp-2Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 int v73; // [sp+2Ch] [bp-28h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 unsigned __int8 *v74; // [sp+30h] [bp-24h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 int v76; // [sp+34h] [bp-20h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 int v77; // [sp+34h] [bp-20h]@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 signed int v78; // [sp+38h] [bp-1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 int v79; // [sp+38h] [bp-1Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 signed int a2b; // [sp+40h] [bp-14h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 char *a2c; // [sp+40h] [bp-14h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767 int a3a; // [sp+44h] [bp-10h]@40
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13768 signed int uCenterY; // [sp+48h] [bp-Ch]@1
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13769 signed int uCenterX; // [sp+4Ch] [bp-8h]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 signed int uZb; // [sp+5Ch] [bp+8h]@27
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13771 signed int uWidth; // [sp+5Ch] [bp+8h]@30
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772 signed int uZd; // [sp+5Ch] [bp+8h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 signed int uZe; // [sp+5Ch] [bp+8h]@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 signed int uZf; // [sp+5Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 signed int uZg; // [sp+5Ch] [bp+8h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 unsigned int uWa; // [sp+60h] [bp+Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777 float uWb; // [sp+60h] [bp+Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13779 unsigned int uWd; // [sp+60h] [bp+Ch]@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 float uZooma; // [sp+64h] [bp+10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 signed int flagsa; // [sp+68h] [bp+14h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782 unsigned int flagsb; // [sp+68h] [bp+14h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 char *flagsc; // [sp+68h] [bp+14h]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 unsigned int flagsd; // [sp+68h] [bp+14h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13786 //a3 = uY;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13787 //a2 = uX;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13788 uCenterX = (uX + uZ) / 2;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13789 uCenterY = (uY + uW) / 2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 lPitch = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13793 auto bWizardEyeActive = pParty->WizardEyeActive();
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13794 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13795 if (CheckHiredNPCSpeciality(0x26u))
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13796 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13797 bWizardEyeActive = true;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13798 uWizardEyeSkillLevel = 2;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13799 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13800 pRenderer->Clip_v2(uX, uY, uZ - 1, uW - 1);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13801 uHeight = uW - uY;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13802 uWidth = uZ - uX;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13803
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807 v74 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 v62 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 v73 = (1 << (v17 + 16)) / (signed int)uZoom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 v18 = (double)(1 << (16 - v17));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 v19 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 v20 = (double)(pParty->vPosition.x + 32768) / v18;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13813 v21 = (double)(32768 - pParty->vPosition.y) / v19;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 uWb = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 if ( uZoom == 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13817 v20 = v20 - (double)(uWidth / 2);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13818 v22 = (double)(uHeight / 2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 if ( uZoom == 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13824 v20 = v20 - (double)(uWidth / 4);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13825 v22 = (double)(uHeight / 4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 if ( uZoom != 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 goto LABEL_37;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13831 v20 = v20 - (double)(uWidth / 8);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13832 v22 = (double)(uHeight / 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 uWb = v21 - v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 LABEL_37:
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13837 //v23 = v20 * 65536.0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13838 //v24 = v23 + 6.7553994e15;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13839 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13840 //uWe = uWb * 65536.0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13841 //v25 = uWe + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 v78 = v70;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13843 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 v26 = (unsigned __int16 *)_56EFD8_minimap;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13845 v27 = uBluea >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 uWc = (unsigned __int16 *)_56EFD8_minimap;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13847 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 if ( flags )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 v64 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13853 if ( uHeight > 0 )
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13854 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13855 a3a = uHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 v29 = v70 >> 16;
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 a2b = 0;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13860 if ( uWidth > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 v30 = (int)&v74[v27 * v64];
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13863 flagsa = uWidth;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13864 a2b = uWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 v31 = uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 ++uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 *v31 = v62[*(char *)(v30 + v29)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 v78 += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 v29 = v78 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 --flagsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 while ( flagsa );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 v78 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 v28 += 137 - a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 uBluea += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 v27 = uBluea >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 --a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 while ( a3a );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13887 uZd = 117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 v32 = 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 *v28 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13898 while ( v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 v28 += lPitch - 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900 --uZd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902 while ( uZd );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903 uNumBlueFacesInBLVMinimap = 0;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13904 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13905 else
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13906 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13907 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13908 uNumBlueFacesInBLVMinimap = 0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13909
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13910 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13911 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13912 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i];
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13913
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13914 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13915 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13916 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13917 if (~pFace1->uAttributes & 0x2000)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13918 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13919 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13920 if (~pFace2->uAttributes & 0x2000)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13921 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13922 v11 = pOutline->uFlags;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923 if ( v11 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 goto LABEL_15;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13925 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 )
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13926 goto LABEL_ABC;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13927 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13928 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13929 continue;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13930
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13931 LABEL_ABC:
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13932 pOutline->uFlags = v11 | 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13933 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13934
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13935 LABEL_15:
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13936 //v12 = &pIndoor->pFaces[pOutline->uFace1ID];
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13937 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13938 (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) &&
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13939 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID))
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13940 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13941 if (uNumBlueFacesInBLVMinimap < 49)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13942 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13943 }
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13944 else
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13945 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13946 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13947 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13948 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13949 v69 = uCenterX + _c;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13950 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
13951 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
13952 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
13953 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
13954 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 if ( v15 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 v15 = 100;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13957 pRenderer->Line2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13958 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13959 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13960
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13961
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 for ( uZb = 0; uZb < (signed int)uNumBlueFacesInBLVMinimap; ++uZb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 {
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13964 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]];
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13965 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]];
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13966 pRenderer->Line2D(
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13967 uCenterX
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13969 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 - uZoom * pParty->vPosition.x) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13971 uCenterY
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13973 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13974 - uZoom * pParty->vPosition.y) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13975 uCenterX
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13977 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 - uZoom * pParty->vPosition.x) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13979 uCenterY
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13981 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13982 - uZoom * pParty->vPosition.y) >> 16),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 uBlue);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13985 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13986
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13987
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13988 //_draw_party_arrow:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 v34 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) < 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 if ( (signed int)v34 <= 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 if ( (signed int)v34 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001 if ( (signed int)v34 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14003 if ( (signed int)v34 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14005 if ( (signed int)v34 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 if ( (signed int)v34 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 if ( (signed int)v34 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14010 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 v57 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14013 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 v57 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 v57 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030 v57 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 v57 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 v35 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038 LABEL_66:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 pRenderer->DrawTextureTransparent(
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14040 uCenterX - 3,
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14041 uCenterY - 3,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 (Texture *)(pTextureIDs_pMapDirs[v35] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v35]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14046 if ( bWizardEyeActive )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 uZe = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 a2c = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 if ( !*((short *)a2c - 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 || !*(short *)a2c
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14056 || uWizardEyeSkillLevel == 1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 || (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
14058 + uCenterX,
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14059 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
14060 v38 = uCenterY - v79,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 v37 < pRenderer->field_1C_clipx)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 || v37 > pRenderer->field_24_clipz
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 || v38 < pRenderer->field_20_clipy
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 || v38 > pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14067 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14070 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14071 pRenderer->Line2D(v37, v38 - 2, v37, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14072 pRenderer->Line2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14073 pRenderer->Line2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 v37 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 v58 = flagsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 v55 = v38 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14079 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, uCenterY - v79, flagsb);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 v58 = flagsb;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14081 v55 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 v53 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 v51 = v38 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 LABEL_82:
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14085 pRenderer->Line2D(v37, v51, v53, v55, v58);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 ++uZe;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 a2c += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 if ( uZe >= (signed int)uNumLayingItems )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 v58 = v60;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14097 v55 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 v53 = v37;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14100 v51 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 goto LABEL_82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, 0, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 uZf = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 if ( (signed int)uNumActors > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 flagsc = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 v39 = *(short *)flagsc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 if ( *(short *)flagsc != 11 && v39 != 19 && (v39 == 5 || *(flagsc - 139) & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 v40 = ((unsigned __int64)(((signed int)*((short *)flagsc - 17) - pParty->vPosition.x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 * (signed __int64)(signed int)uZoom) >> 16)
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14118 + uCenterX;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14119 v76 = (unsigned __int64)(((signed int)*((short *)flagsc - 16) - pParty->vPosition.y)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120 * (signed __int64)(signed int)uZoom) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14121 v41 = uCenterY - v76;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 if ( v40 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 if ( v40 <= pRenderer->field_24_clipz && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 uWd = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 if ( *(flagsc - 137) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 uWd = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 if ( *(short *)flagsc == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14130 uWd = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 if ( (signed int)uZoom > 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14133 pRenderer->Line2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14134 pRenderer->Line2D(v40, v41 - 2, v40, v41 + 2, uWd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14135 pRenderer->Line2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14136 v42 = v41 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 v43 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 v44 = v42;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14139 pRenderer->Line2D(v40 - 2, v43, v40 - 2, v42, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 v40 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 v59 = uWd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 v56 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 v52 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14148 pRenderer->Line2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 v59 = uWd;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14150 v56 = uCenterY - v76;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 v52 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14154 pRenderer->Line2D(v40, v52, v54, v56, v59);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 ++uZf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 flagsc += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 while ( uZf < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 uZg = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 if ( (signed int)uNumLevelDecorations > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 v45 = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 lPitchb = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 if ( *(v45 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 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
14177 + uCenterX;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14178 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
14179 v47 = uCenterY - v77;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 if ( v46 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 if ( v46 <= pRenderer->field_24_clipz && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 v48 = v47 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 v49 = v47 - 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14188 pRenderer->Line2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14189 pRenderer->Line2D(v46, v49, v46, v48, flagsd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14190 pRenderer->Line2D(v46 + 1, v49, v46 + 1, v48, flagsd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 v45 = lPitchb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14195 pRenderer->Line2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 ++uZg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 v45 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 lPitchb = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 while ( uZg < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 v33,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 (Texture *)(dword_5079D8 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079D8] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 uZooma = (double)pParty->sRotationY * 0.1171875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 v50 = uZooma + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 LODWORD(v50) + 285,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 0x88u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 (Texture *)(dword_5079B4 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079B4] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 //----- (00442955) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 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
14224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 unsigned int *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 unsigned __int8 v8; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 unsigned __int8 v9; // sf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 unsigned int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 __int16 v12; // cx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 signed int v13; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 Vec3_short_ *v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 Vec3_short_ *v18; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 int v19; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 signed int v21; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 int v22; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 Vec3_short_ *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 Vec3_short_ *v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 int v26; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 unsigned __int16 *v27; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 int v28; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 double v30; // st7@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 signed __int64 v31; // qax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 char *v32; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 int v33; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 signed int v34; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 signed int v35; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 int v36; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 int v37; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 int v38; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 unsigned int v39; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 const void *v40; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 unsigned __int16 *v41; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 unsigned __int8 v42; // cf@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 unsigned int v43; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 int v44; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 int v45; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 int v46; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 signed int v47; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 signed int v48; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 int v49; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 signed int v50; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 unsigned int v51; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 int result; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 int v53; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 int v54; // esi@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 int v55; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 __int16 v56; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 double v57; // st7@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 int v58; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 signed __int64 v59; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 signed int v60; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 signed __int64 v61; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 signed int v62; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 signed int v63; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 int v64; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 unsigned int v65; // ebx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 char *v66; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 unsigned __int16 *v67; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 int v68; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 unsigned __int16 v69; // cx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 unsigned int v70; // [sp-10h] [bp-48074h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 unsigned int v71; // [sp-Ch] [bp-48070h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 signed int v73; // [sp-4h] [bp-48068h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 char v75; // [sp+Ch] [bp-48058h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 int v76; // [sp+4800Ch] [bp-58h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 unsigned __int16 *v78; // [sp+48014h] [bp-50h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 unsigned int v79; // [sp+48018h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 unsigned int y_; // [sp+4801Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 int v81; // [sp+48020h] [bp-44h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 unsigned int x_; // [sp+48024h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 int v84; // [sp+4802Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 int v85; // [sp+48030h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 int v86; // [sp+48034h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 int v87; // [sp+48038h] [bp-2Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 int black; // [sp+48040h] [bp-24h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 int v90; // [sp+48044h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 unsigned int i; // [sp+48048h] [bp-1Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 unsigned int v92; // [sp+4804Ch] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 unsigned int v94; // [sp+48054h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 unsigned int v95; // [sp+48058h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 int v96; // [sp+4805Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 const void *v97; // [sp+48060h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 char *a4a; // [sp+4806Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 int a5a; // [sp+48070h] [bp+Ch]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 y_ = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 v85 = (signed int)(x + a4) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 v90 = (signed int)(y + a5) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 v79 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 pRenderer->Clip_v2(x, y, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 v5 = viewparams->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 v6 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 v86 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 v84 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 if ( viewparams->field_2C != 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 if ( viewparams->field_2C == 768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 v5 = 680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 v94 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 v92 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 v93 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 v95 = (unsigned int)pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 v78 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 v87 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 black = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 v96 = 32768 - black - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 v31 = (signed __int64)((double)v96 / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 v32 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 v33 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 v34 = (int)v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 v76 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 if ( v95 && (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 v36 = v95 + v35 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 i = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 v88 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 v37 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 v77 = (unsigned __int16 *)v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 *(short *)v32 = v78[*((char *)v77 + v37)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 v32 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 v97 = (char *)v97 + v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 v37 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 --i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 while ( i );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 v34 += v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 v97 = (const void *)teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 black = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 v32 += 2 * (v94 - v88);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 v35 = v34 >> 16;
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 v97 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 if ( (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 v38 = 2 * (v79 - v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 v39 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 v40 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 v41 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 v42 = v94 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 v43 = v94 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 memcpy(v93, v97, 4 * (v94 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 v45 = (int)((char *)v40 + 4 * v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 v44 = (int)&v41[2 * v43];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 v46 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 v39 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 v93 = (unsigned __int16 *)((char *)v93 + v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 v97 = (char *)v97 + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 while ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 *(short *)v44 = *(short *)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 v45 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 v44 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 --v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 v93 = (unsigned __int16 *)((char *)v93 + v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 v6 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 v86 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 v84 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 v5 = viewparams->field_2C - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14439 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 uNumBlueFacesInBLVMinimap = 0;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14441 v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14442 v9 = (pIndoor->pMapOutlines->uNumOutlines & 0x80000000u) != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 if ( !(v9 | v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 v10 = (int)((char *)v7 + i + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 if ( BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 v12 = *(short *)((char *)v7 + i + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 if ( !(v12 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 if ( !(v96 & 0x80) && (v11 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 v96 = (signed int)v94 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 v13 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 *(short *)(v10 + 10) = v12 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 v14 = *(short *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 v88 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 v15 = &pIndoor->pVertices[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 v16 = v15->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 v17 = v15->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 v93 = (unsigned __int16 *)(v16 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 v92 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 v19 = v18->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 v20 = v18->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 v95 = v19 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 v97 = (const void *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14479 pRenderer->Line2D(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 v85 + v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 v90 - v87,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 v90 - v92,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484 black);
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14485 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 ++v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 i += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 while ( (signed int)v94 < (signed int)*v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 v22 = pBlueFacesInBLVMinimapIDs[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 v87 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 v23 = (int)&v7[3 * v22 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 v24 = &pIndoor->pVertices[*(short *)v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 v25 = &pIndoor->pVertices[*(short *)(v23 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 v26 = v25->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 v27 = (unsigned __int16 *)(v24->x - v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504 v28 = v24->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 v29 = v25->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 v93 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 v92 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 v97 = (const void *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14510 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14511 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14513 pRenderer->Line2D(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514 v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515 v90 - v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516 v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 v90 - v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 teal);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14519 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 break;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14522 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14528 v81 = pParty->vPosition.y - v84;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14529 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 v49 = v90 - (int)v97 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 if ( v47 >= (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 if ( v47 > (signed int)a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 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
14537 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 v47 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85) < (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 v47 = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 if ( v49 >= (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 if ( v49 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 if ( v90 - (signed int)v97 - 6 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 v49 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 if ( v90 - (signed int)v97 < (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 v49 = y_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 if ( v48 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 if ( (signed int)v51 > 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 if ( (signed int)v51 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 if ( (signed int)v51 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 if ( (signed int)v51 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 if ( (signed int)v51 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 if ( (signed int)v51 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 if ( (signed int)v51 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 v73 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 v73 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 v73 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 v73 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 v73 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 v73 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 v50 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 pRenderer->_4A6776(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 v47,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 v86 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 v94 = (unsigned int)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 if ( *(char *)(v94 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 v53 = *(int *)(v94 + 4) - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 v93 = (unsigned __int16 *)(*(int *)v94 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 v92 = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 v55 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 if ( v54 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 if ( v54 <= pRenderer->field_24_clipz && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 if ( v5 > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 v96 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 black = v55 - 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14644 pRenderer->Line2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14645 pRenderer->Line2D(v54, black, v54, v96, v86);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 v72 = v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 v71 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 v70 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 v72 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 v70 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14658 pRenderer->Line2D(v54, v70, v71, v72, v74);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 ++v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 result = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 v94 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 v90 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 v95 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 v77 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 black = (1 << (v56 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 v57 = (double)(1 << (16 - v56));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 v58 = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 v60 = (int)v59 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 v97 = (const void *)((int)v59 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 v78 = (unsigned __int16 *)(v60 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 v62 = (int)v61 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 teal = v60 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 v63 = (signed __int16)v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 a4a = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 for ( i = result; v85 < (signed int)v95; result = v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 a5a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 v96 = (v63 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 v64 = teal;
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 v81 = (v64 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 if ( !pOutdoor->_47F04C(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 if ( pOutdoor->_47F097(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 if ( !((a5a + v85) % 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 *(short *)a4a = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 *(short *)a4a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 a4a += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 v97 = (char *)v97 + black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 v64 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 ++a5a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 while ( a5a < v90 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 v62 += black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 v97 = (const void *)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 a4a += 2 * (v90 - a5a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 v63 = v62 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 ++v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 teal = (unsigned int)v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 v65 = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 v66 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726 if ( (signed int)v95 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 v67 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 result = 2 * (v79 - v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 v68 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 v69 = *(short *)v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 if ( !*(short *)v66 || v69 == (short)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 *v67 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 v66 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 ++v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 --v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 while ( v68 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 v67 = (unsigned __int16 *)((char *)v67 + result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 --v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 while ( v65 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 //----- (00443219) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 int ViewingParams::_443219()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 this->sPartyPosZ += 512;
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 //----- (00443225) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 int ViewingParams::_443225()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 this->sPartyPosX -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769 //----- (00443231) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 int ViewingParams::_443231()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 this->sPartyPosZ -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14776 //----- (0044323D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 int ViewingParams::_44323D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779 this->sPartyPosX += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 //----- (00443249) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 int ViewingParams::_443249()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 if ( v1 < 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 this->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 this->sPartyPosX = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14793 this->sPartyPosZ = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 //----- (00443291) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 int ViewingParams::_443291()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 v1 = 2 * this->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 v2 = 1536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 v2 = 3072;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 if ( v1 > v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 this->field_2C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 this->sPartyPosX = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14811 this->sPartyPosZ = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 //----- (004432E7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 int ViewingParams::_4432E7()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 int v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 int v7; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 int result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 v2 = this->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 v3 = 88 >> this->field_2C / 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 v4 = (44 - v3) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 if ( v1->sPartyPosZ > v2 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 v1->sPartyPosZ = v2 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 v5 = v1->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 v6 = (v3 - 44) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 if ( v1->sPartyPosX < v5 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 v1->sPartyPosX = v5 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 v7 = v2 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 if ( v1->sPartyPosZ < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 v1->sPartyPosZ = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 result = v5 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 if ( v1->sPartyPosX > v5 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 v1->sPartyPosX = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 //----- (00443343) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847 unsigned int ViewingParams::_443343()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 unsigned __int16 *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 v2 = this->pPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 *v2 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 while ( v1 < 256 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 //----- (00443365) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 int ViewingParams::_443365()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 __int16 *v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 Vec3_short_ *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 unsigned int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 signed int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 Vec3_short_ *v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 signed int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 signed int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 char v9; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 unsigned int v11; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 unsigned int *v12; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 unsigned int v13; // [sp+Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 unsigned int v14; // [sp+10h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 unsigned int v15; // [sp+14h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 unsigned int v16; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 unsigned int v17; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 _443343();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 v16 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 v14 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 v17 = 0xC0000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 v15 = 0xC0000000u;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14895 if ( (signed int)pIndoor->pMapOutlines->uNumOutlines > 0 )
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14896 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14897 v2 = (__int16 *)(pIndoor->pMapOutlines->pOutlines);
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14898 v11 = pIndoor->pMapOutlines->uNumOutlines;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14899 v12 = (uint *)pIndoor->pMapOutlines->pOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 v3 = &pIndoor->pVertices[*v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 v4 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 if ( (signed int)v4 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 v16 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 if ( (signed int)v4 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 v17 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 v5 = v3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 v13 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 if ( v5 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 v14 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 if ( v5 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 v15 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 v6 = &pIndoor->pVertices[v2[1]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 v7 = v6->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 if ( v7 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 v16 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 if ( v7 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 v17 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 v8 = v6->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 if ( v8 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 if ( v8 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 v15 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 v2 = (__int16 *)(v12 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 v9 = v11-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 v12 += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 while ( !v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931 v1->uMinimapZoom = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 v1->field_38 = (signed int)(v16 + v17) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 v1->field_28 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 result = (signed int)(v14 + v15) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 v1->field_3A = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 v1->field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 v1->field_3A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941 v1->uMinimapZoom = dword_576E2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942 result = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 v1->field_28 = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 v1->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 //----- (00443801) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 int __cdecl Initialize2DA()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 const char *v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 _2devent *v1; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 char *v2; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 int v3; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 char v4; // cl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 int v6; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 int v7; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 int result; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 signed int v9; // [sp+10h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 signed int v10; // [sp+14h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 int it = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 if ( p2DEventsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 pAllocator->FreeChunk(p2DEventsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 p2DEventsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 p2DEventsTXT_Raw = (char *)pEvents_LOD->LoadRaw("2dEvents.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 strtok(p2DEventsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 v1 = p2DEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 v2 = strtok(0, v0) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 v3 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 v9 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 v4 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 while ( v4 != 9 && v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 v4 = v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 v6 = (int)&v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 if ( !v2[v5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 *(char *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 switch ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 if ( _strnicmp(v2, "wea", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 if ( _strnicmp(v2, "arm", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 if ( _strnicmp(v2, "mag", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 if ( _strnicmp(v2, "alc", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 if ( _strnicmp(v2, "sta", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 if ( _strnicmp(v2, "boa", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 if ( _strnicmp(v2, "tem", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 if ( _strnicmp(v2, "tra", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 if ( _strnicmp(v2, "tow", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 if ( _strnicmp(v2, "tav", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 if ( _strnicmp(v2, "ban", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 if ( _strnicmp(v2, "fir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 if ( _strnicmp(v2, "air", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 if ( _strnicmp(v2, "wat", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 if ( _strnicmp(v2, "ear", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 if ( _strnicmp(v2, "spi", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 if ( _strnicmp(v2, "min", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 if ( _strnicmp(v2, "bod", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 if ( _strnicmp(v2, "lig", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 if ( _strnicmp(v2, "dar", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 if ( _strnicmp(v2, "ele", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 if ( _strnicmp(v2, "sel", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 if ( _strnicmp(v2, "mir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 v7 = -(_strnicmp(v2, "mer", 3u) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 LOBYTE(v7) = v7 & 0xEE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047 v1->uType = v7 + 18;
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 = 16;
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 = 15;
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 = 14;
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 = 13;
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 = 12;
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 = 11;
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 = 10;
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 = 9;
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 = 8;
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 = 7;
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 = 6;
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 = 5;
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 = 22;
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 = 21;
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 = 17;
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 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 v1->uType = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 v1->uType = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 v1->uType = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 v1->uType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 v1->uType = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 v1->uType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 v1->uType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 v1->uAnimationID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 v1->pName = (char *)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 v1->pProprieterName = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 v1->pProprieterTitle = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 v1->field_14 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 v1->_state = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 v1->_rep = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 v1->_per = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 v1->fPriceMultiplier = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 v1->flt_24 = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 v1->field_1C = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 v1->uOpenTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 v1->uCloseTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 v1->uExitPicID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 v1->uExitMapID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 v1->_quest_related = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 v1->pEnterText = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 v2 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 v3 = v9 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 result = v3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 while ( v3 + 1 <= 23 && !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 //if ( (signed int)v1 >= (signed int)&unk_597F10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 if (++it >= 525)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 //----- (00443CE1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 unsigned int __fastcall LoadEventsToBuffer(const char *pContainerName, char *a2, unsigned int uBufferSize)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 char Args; // [sp+8h] [bp-B4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 //Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 void *Dst; // [sp+B4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 void *ptr; // [sp+B8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 v3 = pContainerName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 Dst = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 //Texture::Texture(&DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 v4 = pEvents_LOD->FindContainer(v3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 Abortf("Unable to load %s", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 fread(&DstBuf, 1u, 0x30u, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 v5 = DstBuf.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 if ( !DstBuf.uDecompressedSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 v5 = DstBuf.uTextureSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 memset(&DstBuf, 0, 0x48u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 if ( (signed int)v5 >= (signed int)uBufferSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 sprintfex(&Args, "File %s Size %lu - Buffer size %lu", v3, v5, uBufferSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 memcpy(Dst, ptr, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 pAllocator->FreeChunk(ptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 //----- (00443DA1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 void __cdecl Initialize_GlobalEVT()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 char *v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT, 0xB400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 if ( uGlobalEVT_Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 uGlobalEVT_NumEvents = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 memset(pGlobalEVT_Events, 128, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 v1 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 v2 = (char *)&pGlobalEVT_Events[uGlobalEVT_NumEvents].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15287 *((int *)v2 - 1) = (unsigned __int8)pGlobalEVT[v0 + 1] + ((unsigned __int8)pGlobalEVT[v0 + 2] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 *(int *)v2 = (unsigned __int8)pGlobalEVT[v0 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 *((int *)v2 + 1) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 v2 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 v0 += (unsigned __int8)pGlobalEVT[v0] + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 while ( v0 < (signed int)uGlobalEVT_Size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294 uGlobalEVT_NumEvents = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298 //----- (00443E31) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 void __cdecl LoadLevel_InitializeLevelStr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 signed __int16 v0; // si@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15302 //unsigned int v1; // ecx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 int v3; // edx@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15305 //int v4; // eax@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 int v6; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 int v7; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 unsigned int *v8; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 char Args[100]; // [sp+Ch] [bp-68h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 int v10; // [sp+70h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15313 if (sizeof(pLevelStrOffsets) != 0x7D0)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15314 Log::Warning(L"pLevelStrOffsets: deserialization warning");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 memset(pLevelStrOffsets, 0, 0x7D0u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15316
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15317 v0 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15318 //v1 = uLevelStrFileSize;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 v10 = 0;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15322 //v4 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15323 for (uint i = 0; i < uLevelStrFileSize; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15324 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15325 if ( !pLevelStr[i] )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 v5 = (signed __int16)v2++;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15328 pLevelStrOffsets[v5] = i + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15329 if ( (signed __int16)(i - (short)v10) > v0 )
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15330 v0 = i - v10;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15331 v10 = i;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15332 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15333 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15334
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 uLevelStrNumStrings = (signed __int16)v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 if ( v0 > 800 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 sprintfex(Args, "MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 Abortf(Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342 if ( (signed __int16)v2 - 1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 v8 = &pLevelStrOffsets[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 if ( RemoveQuotes(&pLevelStr[*v8]) != &pLevelStr[*v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 ++*v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15350 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 v7 = (signed __int16)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 //----- (00443EF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 void __cdecl LoadLevel_InitializeLevelEvt()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15359 {
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15360 if (!uLevelEVT_Size)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15361 return;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15362
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15363 memset(array_5B5928, 0, 0xC80u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15364 memset(pLevelEVT_Events, 128, 0xCE40u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15365
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15366 uLevelEVT_NumEvents = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15367 dword_5B65C8 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15368
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15369 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15370 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15371 pLevelEVT_Events[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15372 pLevelEVT_Events[i].field_4 = pLevelEVT[j + 3];
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15373 pLevelEVT_Events[i].uEventOffsetInEVT = j;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15374 j += pLevelEVT[j] + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15375
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15376 uLevelEVT_NumEvents++;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15377 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15378 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 //----- (00443F95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 void __cdecl OnMapLeave()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 char *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 int v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 if ( (signed int)uLevelEVT_NumEvents > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 v1 = (char *)&pLevelEVT_Events[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 v2 = *((int *)v1 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 dword_597F18 = *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 EventProcessor(v2, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 v1 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 while ( v0 < (signed int)uLevelEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15406
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 //----- (00443FDC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 void OnMapLoad()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411 stru176 *v3; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 __int16 v4; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 __int16 v5; // di@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 signed __int64 v8; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416 unsigned int v9; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 signed __int64 v10; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 signed __int64 v11; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 int v12; // ST50_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 signed __int64 v13; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421 signed __int64 v14; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15422 int v15; // ST58_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15423 signed __int64 v16; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424 int v17; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 signed __int64 v19; // [sp+14h] [bp-3Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 int v22; // [sp+2Ch] [bp-24h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429 int v24; // [sp+34h] [bp-1Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430 int v25; // [sp+38h] [bp-18h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431 int v26; // [sp+3Ch] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432 int v27; // [sp+3Ch] [bp-14h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 int v28; // [sp+40h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 __int16 v29; // [sp+46h] [bp-Ah]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435 __int16 v30; // [sp+48h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15436 __int16 v31; // [sp+4Ah] [bp-6h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 __int16 v32; // [sp+4Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 __int16 v33; // [sp+4Eh] [bp-2h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15440 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15441 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15442 auto pEvent = pLevelEVT_Events + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15443
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15444 auto _evt = (_evt_raw *)(pLevelEVT + pEvent->uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15445
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15446 if (_evt->v4 == 3)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15447 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15448 pSoundList->_4A9A67(
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15449 _evt->v5 +
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15450 ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15451 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15452 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15453 else if (_evt->v4 == 37)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15454 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15455 dword_597F18 = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15456 EventProcessor(pEvent->uEventID, 0, 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15457 dword_597F18 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15458 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15459 else if (_evt->v4 == 31 || _evt->v4 == 38)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15460 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15461 v3 = &array_5B5928[dword_5B65C8];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15462 v20 = pOutdoor->uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15463 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15464 v20 = pIndoor->stru1.uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15465
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15466 v4 = _evt->v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15467 v3->field_1C = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15468 v3->field_8 = pEvent->uEventID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15469 v3->field_A = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15470 v33 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15471 v3->field_12 = v33;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15472 v32 = _evt->v7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15473 v3->field_14 = v32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15474 v31 = _evt->v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15475 v3->field_16 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15476 v5 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15477 v30 = _evt->v9;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15478 v3->field_18 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15479 v29 = _evt->v10;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15480 v3->field_1A = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15481
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15482 v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15483 v3->field_10 = v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15484 v3->field_C = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15485 v3->field_E = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15486 if ( v4 == 38 && !(short)v6 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15487 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15488 if ( v20 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15489 v18 = pParty->uTimePlayed - v20;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15490 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15491 v18 = 0i64;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15492 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
15493
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15494 if ( v26 / 7 / 4 / 12 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15495 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15496 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15497 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15498 v3->field_4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15499 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15500 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15501 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15502 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15503 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15504 if (v26 / 7 / 4 != 0 && v33 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15505 v26 / 7 != 0 && v32 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15506 v26 != 0 || !v20)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15507 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15508 v3->field_4 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15509 ++dword_5B65C8;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15510 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15511 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15512 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15513 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15514
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15515 v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15516 v9 = v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15517 v10 = (signed int)v8 / 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15518 v22 = v10 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15519 v11 = (signed int)(v10 / 60);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15520 v12 = v11 % 24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15521 v13 = (signed int)(v11 / 24);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15522 v27 = v13 % 7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15523 v14 = (signed int)(v13 / 7);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15524 v15 = v14 % 4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15525 v16 = (signed int)(v14 / 4);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15526 v24 = v16 / 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15527
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15528 auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15529 auto _2 = ((__int64)v9 << 32) | _1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15530
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15531 v19 = _2 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15532 //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
15533 // v9)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15534 // % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15535
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15536 v17 = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15537 v25 = v15;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15538 v28 = v16 % 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15539 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15540 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15541 ++v24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15542 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15543 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15544 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15545 if ( v33 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15546 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15547 ++v28;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15549 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15551 if ( v32 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15552 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15553 ++v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15554 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15555 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15556 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15557 ++v27;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15558 v22 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15559 v17 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15560 v19 = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15561 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15562 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15563 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15564 auto v0 = (signed __int64)((double)((v19
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15565 + 0x3C * v22
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15566 + 0xE10 * v17
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15567 + 0x93A80 * v25
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15568 + 0x15180 * v27
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15569 + 0x24EA00 * (v28 + 12i64 * v24)) << 7)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15570 * 0.033333335);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15571 v3->field_4 = HIDWORD(v0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15572
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15573 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15574 v3->field_0 = v0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15575 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15576 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15577 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 //----- (00444360) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 void __thiscall Level_LoadEvtAndStr(const char *pLevelName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 char pContainerName[120]; // [sp+8h] [bp-98h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15584 sprintf(pContainerName, "%s.evt", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15586
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15587 sprintf(pContainerName, "%s.str", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15589 if (uLevelStrFileSize)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 LoadLevel_InitializeLevelStr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 //----- (004443D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 char *__cdecl _4443D5_GetMinimapRightClickText()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 int v0; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 double v3; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 BSPModel *v8; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 unsigned __int8 v9; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15606 char v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 ODMFace *v12; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 __int16 v13; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 const char *v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 const char *v15; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 unsigned int v17; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 unsigned int v18; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 int v19; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 int v20; // [sp+14h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 char *v21; // [sp+18h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618 unsigned int pY; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619 int v23; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620 int v24; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 int pX; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 v24 = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
15624 v0 = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 v1 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 v18 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 v3 = 1.0 / *(float *)&v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632 v23 = pX - 557;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 v17 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 if ( v17 == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 result = "No Maze Info for this maze on file!";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 result = pMapStats->pInfos[v17].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653 v7 = sub_4621DA(v6, v5, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 v9 = pOutdoor->pBModels[v4].uNumFaces == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 v12 = &v8[v4].pFaces[v2 / 0x134u];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 v13 = v12->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 if ( !(BYTE2(v12->uFaceAttributes) & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 v14 = _444732_GetEventHintString(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 if ( _strcmpi(v14, nullstring) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 v21 = (char *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 v2 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 result = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 if ( v23 >= (signed int)v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 //----- (00444564) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 const char *__cdecl sub_444564()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 double v0; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 int v1; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 int v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 int v5; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 BSPModel *v8; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 unsigned __int8 v9; // zf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 unsigned __int8 v10; // sf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 ODMFace *v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 __int16 v12; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 const char *v13; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 const char *v14; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 const char *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 unsigned int v16; // [sp+0h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 const char *v17; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 unsigned int pY; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 float v19; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 int v20; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 int v21; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 unsigned int v22; // [sp+18h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 int pX; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 v20 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 v21 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 v19 = (double)viewparams->field_2C * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 if ( viewparams->field_2C == 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 v20 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 v21 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 v16 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 v0 = 1.0 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 v1 = (signed __int64)((double)(pX - 229) * v0 + (double)v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 LODWORD(v19) = (signed __int64)((double)v21 - (double)(signed int)(pY - 181) * v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 v2 = abs(v1 + 22528) / 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 v3 = abs((signed)LODWORD(v19) - 22528);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 if ( pOutdoor->_47F04C(v2, v3 / 512)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 && uCurrentlyLoadedLevelType == LEVEL_Outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 && (v4 = 0, v20 = 0, (signed int)v16 > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 pX = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.x + v4) - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 pY = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.y + v4) - LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 v7 = sub_4621DA(v6, v5, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 if ( v7 < *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 v9 = *(unsigned int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 v10 = *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 if ( !(v10 | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 v11 = &(*(ODMFace **)((char *)&v8->pFaces + v4))[v22 / 0x134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 v12 = v11->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 if ( !(BYTE2(v11->uFaceAttributes) & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 v13 = _444732_GetEventHintString(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 if ( _strcmpi(v13, nullstring) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 v17 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 v22 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 while ( v21 < *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 result = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 v4 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 if ( v20 >= (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 //----- (00444A51) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 char *__cdecl TransitionUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 MapInfo *v0; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 char *v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 std::string v3; // [sp-18h] [bp-84h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 unsigned int v4; // [sp-10h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 int v5; // [sp-Ch] [bp-78h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 const char *v6; // [sp-8h] [bp-74h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 signed int v7; // [sp-4h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 GUIWindow v8; // [sp+Ch] [bp-60h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 unsigned int v9; // [sp+60h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 unsigned int v10; // [sp+64h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 int a3; // [sp+6Bh] [bp-1h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 memcpy(&v8, pGUIWindow0, sizeof(v8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 uTextureID_507B04 = uTextureID_right_panel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 0x22Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 0x1DCu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 v0 = &pMapStats->pInfos[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 v8.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850 v8.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 v8.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 v8.DrawText2(pFontCreate, 0, 5u, 0, v0->pName, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 v8.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 v8.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 v8.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 if ( uCurrentHouse_Animation )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 v1 = (&off_4EB080)[4 * uCurrentHouse_Animation];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 v1 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 v1 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 MessageBoxW(nullptr, L"No transition text found!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1410", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 v1 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 v7 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 v6 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 result = v8.DrawText2(pFontCreate, 0, v4, v5, v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 //----- (00444C8F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 GUIWindow *__cdecl UI_CreateTravelDialogue()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 signed int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 unsigned int v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 GUIWindow *result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 const char *v3; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 char pContainer[32]; // [sp+0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 v0 = const_2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 sprintfex(pContainer, "evt%02d", v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 if ( pParty->uAlignment != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 v3 = "-c";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 v3 = "-b";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 strcat(pContainer, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("outside", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 v1 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 sprintfex(byte_591098, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 strcpy(byte_591098, pGlobalTXT_LocalizationStrings[79]);// "Exit"
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15917 result = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)17, 0, (int)byte_591098);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 pDialogueWindow = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 //----- (00444D80) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 signed int __cdecl GetTravelTime()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 v0 = uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 if ( CheckHiredNPCSpeciality(5u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 if ( CheckHiredNPCSpeciality(6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 v0 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 if ( CheckHiredNPCSpeciality(7u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 v0 -= 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 if ( CheckHiredNPCSpeciality(0x2Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 if ( v0 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 // 6BD07C: using guessed type int uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 //----- (00444DCA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 void __cdecl TravelUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 unsigned int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 MapInfo *v1; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 char *v2; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 const char *v5; // [sp-Ch] [bp-90h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 signed int v6; // [sp-8h] [bp-8Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 GUIWindow v7; // [sp+Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 unsigned int v9; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 memcpy(&v7, pGUIWindow0, sizeof(v7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 v9 = pMapStats->GetMapInfo(pCurrentMapName);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
15958 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 v0 = pMapStats->GetMapInfo(pDestinationMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 pRenderer->DrawTextureTransparent(0x1D4u, 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 v1 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 v7.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 v7.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 v2 = v1->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 v7.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 v7.DrawText2(pFontCreate, 0, 4u, 0, v2, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 v7.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 v7.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 v7.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 v3 = GetTravelTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 sprintfex(pTmpBuf, v5, v6, v1->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 v4 = pFontCreate->CalcTextHeight(pTmpBuf, &v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 v7.DrawText2(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 //----- (00444FBE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 void __cdecl DrawBranchlessDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 GUIFont *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 int v1; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 char *v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 int v3; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 char Str[200]; // [sp+Ch] [bp-120h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 GUIWindow v5; // [sp+D4h] [bp-58h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 GUIFont *pFont; // [sp+128h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 v0 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 pFont = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 if ( ptr_F8B1E8 && !byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 strcpy(byte_5B0938, ptr_F8B1E8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 v5.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 v5.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 if ( 352 - v1 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 pFont = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 352 - v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029 pRenderer->DrawTextureIndexed(8u, 347 - v1, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 if ( pGUIWindow2->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 if ( pGUIWindow2->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 strcpy(GameUI_StatusBar_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 sub_4452BB();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043 if ( pGUIWindow2->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 memset(GameUI_StatusBar_TimedString, 0, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 if ( pGUIWindow2->ptr_1C == (void *)26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052 sprintfex(Str, "%s %s", GameUI_StatusBar_TimedString, pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053 v3 = pFontLucida->GetLineWidth(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 if ( pKeyActionMap->pPressedKeysBuffer[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 pKeyActionMap->_459ED1(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 //----- (004451A8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073 if ( !pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 if ( pParty->uFlags & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 pGame->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 dword_5C3418 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 dword_5C341C = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 _591094_decoration = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 //----- (004452BB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 void __cdecl sub_4452BB()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 _5C3420_pDecoration = _591094_decoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 dword_597F18 = dword_5C341C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 EventProcessor(dword_5C3418, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 //----- (00445308) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16107 const char *__fastcall sub_445308(int a1)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16108 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 if ( a1 == 10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 || a1 == 11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 || a1 == 12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 || a1 == 33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 || a1 == 34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 || a1 == 39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 || a1 == 40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 || a1 == 41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 || a1 == 42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 || a1 == 43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 || a1 == 52 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16120 return (const char *)*(&pNPCStats->field_13A60 + 5 * a1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16121 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16122 return pNPCTopics[407].pTopic;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16123 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16124
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 //----- (00445350) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 void __cdecl DrawDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 NPCData *v0; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 unsigned __int16 v2; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 int v5; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 char *v6; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 char *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 unsigned int v8; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 char *v10; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 int v11; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 int v12; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 char *v13; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 GUIButton *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 GUIButton *v15; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 signed int v16; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 int v17; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 int v18; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 int v19; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 int v20; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 int v21; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 int v22; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152 unsigned int v23; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16153 const char *v24; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 int v26; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 int v27; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 int v28; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 unsigned __int16 v30; // cx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 int v31; // ecx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 int v32; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 unsigned int v33; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 GUIWindow *v34; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164 int v35; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165 int i; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 GUIButton *v37; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 int v38; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168 signed int v39; // esi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169 signed int v40; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 unsigned int v41; // ebx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171 int v42; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 GUIButton *v43; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 int v44; // eax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 unsigned int v45; // ecx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 unsigned __int16 *v46; // edx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 unsigned __int16 v47; // ax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 char pFont; // [sp+4h] [bp-110h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 int v49; // [sp+Ch] [bp-108h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 int v50; // [sp+14h] [bp-100h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 GUIWindow v51; // [sp+58h] [bp-BCh]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 GUIWindow v52; // [sp+ACh] [bp-68h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 char *Str; // [sp+100h] [bp-14h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 __int16 v54[2]; // [sp+104h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 char *pInString; // [sp+110h] [bp-4h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 if ( !pDialogueWindow )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 memcpy(&v51, pDialogueWindow, sizeof(v51));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 v51.uFrameWidth -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 v51.uFrameZ -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 *(int *)v54 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 v3 = v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v0->pName, aNPCProfessionNames[v3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 strcpy(pTmpBuf, v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 v51.DrawText2(pFontArrus, 0x1E3u, 0x70u, v2, v4, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 pParty->GetPartyFame();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 if ( (signed int)uDialogueType > 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 if ( uDialogueType == 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 v7 = pGlobalTXT_LocalizationStrings[577]; // "Get back in there you wimps:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 if ( uDialogueType == 91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 sprintfex(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232 pInString = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 if ( uDialogueType == 92 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 if ( uDialogueType == 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 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
16247 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 if ( uDialogueType == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 if ( (signed int)uDialogueType > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 if ( (signed int)uDialogueType > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 if ( uDialogueType == 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 if ( byte_F8B1EC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 pInString = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 if ( byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 goto LABEL_24;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16284 v7 = (char *)ptr_F8B1E8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 if ( *(int *)v54 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 v11 = v0->greet;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 v10 = (char *)*(&pNPCStats->field_17884 + ((v0->uFlags & 3) == 2) + 2 * v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 if ( *(int *)v54 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 pInString = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 if ( v10 == (char *)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 v49 = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 v50 = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 v12 = pFontArrus->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 if ( 352 - v12 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 v12 = pFontCreate->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 352 - v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 v13 = FitTextInAWindow(pInString, pOutString, (GUIWindow *)&pFont, 0xDu, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 memcpy(&v52, pDialogueWindow, sizeof(v52));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 v52.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 v52.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 v52.uFrameZ = 334;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16341 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16342 (signed int)pOutString < v52.pStartingPosActiveItem + v52.pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 pOutString = (GUIFont *)((char *)pOutString + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 v14 = v52.GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 v16 = v14->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 if ( v16 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 v25 = v16 - 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 if ( v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 v27 = v26 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 v28 = v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 if ( v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 v29 = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 if ( v29 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16368 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 v24 = pGlobalTXT_LocalizationStrings[581];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 v24 = pGlobalTXT_LocalizationStrings[580];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 v24 = pGlobalTXT_LocalizationStrings[579];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 v24 = pGlobalTXT_LocalizationStrings[578];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 v24 = pGlobalTXT_LocalizationStrings[407];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 v24 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 v24 = pGlobalTXT_LocalizationStrings[406];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 if ( v16 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 v23 = v0->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 v24 = (&dword_721660)[8 * v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 v24 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 v15->uControlParam = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 v17 = v16 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420 v24 = (const char *)sub_445308(v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 v18 = v17 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 v19 = v18 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 v23 = v0->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 v23 = v0->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 v21 = v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 v23 = v0->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 v23 = v0->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 if ( v22 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 v23 = v0->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16456 v24 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 v24 = pGlobalTXT_LocalizationStrings[122];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 LABEL_79:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16466 pInString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
16469 v55 = (unsigned short *)&pActors[0].uAIState;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 *(int *)v54 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 v30 = *v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 ++pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 v55 += 418;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 --*(int *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 while ( *(int *)v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 if ( pInString == (char *)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 v24 = pGlobalTXT_LocalizationStrings[658];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 strcpy(v15->pButtonName, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490 *(int *)v54 = v33;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16491 v35 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16492 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 v37 = v34->GetControl(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 v32 += v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16505 v39 = v34->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 pOutString = (GUIFont *)((174 - v32) / v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 if ( (174 - v32) / v39 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 v55 = (unsigned __int16 *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 v40 = 174 - (int)pOutString * v39 - v32;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16513 v41 = v34->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 v42 = v40 / 2 - (signed int)pOutString / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 if ( (signed int)v41 < (signed int)(v41 + v39) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 v43 = v34->GetControl(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 v43->uY = (unsigned int)((char *)pOutString + v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 Str = v43->pButtonName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 v45 = v43->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 v46 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 v43->uHeight = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 v42 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 v43->uW = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 v47 = v54[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16531 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 v47 = (unsigned __int16)pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 v52.DrawText2(pFontArrus, 0, v45, v47, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 v55 = (unsigned __int16 *)((char *)v55 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16538 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 //----- (004459F9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 NPCData *__fastcall GetNPCData(unsigned int npcid)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 int v3; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 int v4; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 int v5; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 NPCData *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 char *v7; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 NPCData *v8; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 char v9; // al@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 std::string v10; // [sp-18h] [bp-2Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 const char *v11; // [sp-8h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 int v12; // [sp-4h] [bp-18h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 std::string *v13; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 int a3; // [sp+13h] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 v1 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 if ( (npcid & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 if ( (signed int)npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 if ( (signed int)npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 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
16573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 return &pNPCStats->pNewNPCData[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 if ( (signed int)npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 if ( v8->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 && (!pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 *v7++ = (char)v13 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 v13 = (std::string *)((char *)v13 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 while ( (signed int)v13 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 v9 = pTmpBuf[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 if ( (unsigned __int8)v9 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 result = &pParty->pHirelings[(unsigned __int8)v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 //----- (00445B2C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 NPCData *v8; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 NPCData *v9; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 int v10; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 char v11; // al@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 std::string v12; // [sp-18h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 const char *v13; // [sp-8h] [bp-24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 int v14; // [sp-4h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 std::string *v15; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 char *v16; // [sp+10h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 int v17; // [sp+14h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 int a3; // [sp+1Bh] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 v2 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 v15 = (std::string *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 if ( npcid >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 if ( npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 if ( npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 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
16654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 *(int *)v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 return &pNPCStats->pNewNPCData[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 *(int *)a2 = npcid - 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 if ( npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 *(int *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 v5 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 v8 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 if ( v8->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 pTmpBuf[v6++] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 while ( (signed int)v8 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 v9 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 v16 = &pTmpBuf[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 if ( v9->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 v10 = (int)v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 *(char *)v10 = v17 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 while ( v17 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 v3 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 v11 = pTmpBuf[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 if ( (unsigned __int8)v11 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 *(int *)v3 = (unsigned __int8)v11 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 result = &pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[v5] + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 *(int *)v3 = (unsigned __int8)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 result = &pParty->pHirelings[(unsigned __int8)pTmpBuf[v5]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 //----- (00445C8B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 int __fastcall sub_445C8B(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 int v3; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 int v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 NPCData *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 char *v7; // ebp@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 NPCData *v8; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 if ( a1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 if ( a1 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 if ( a1 >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 if ( v8->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 *v7++ = v1 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 while ( v1 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 //----- (0044603D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 void __cdecl sub_44603D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773 uDialogue_SpeakingActorNPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 //----- (004465DF) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16782 int sub_4465DF_check_season(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 unsigned int v2; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16786 int v3; // ecx@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 char v6; // zf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 v1 = pParty->uCurrentMonth + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 v2 = pParty->uDaysPlayed + 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16792 if ( a1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16793 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16794 v3 = a1 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16797 v4 = v3 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 if ( v1 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 if ( (signed int)v1 >= 1 && (signed int)v1 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 v6 = v1 == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 if ( !v6 || (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 if ( v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 if ( (signed int)v1 >= 10 && (signed int)v1 <= 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 v6 = v1 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 if ( v1 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 if ( (signed int)v1 >= 7 && (signed int)v1 <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 v6 = v1 == 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 if ( v1 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 if ( (signed int)v1 >= 4 && (signed int)v1 <= 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 v6 = v1 == 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 if ( (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 //----- (0044665D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 // uType: 0 -> any monster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 // 1 -> uParam is GroupID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 // 2 -> uParam is MonsterID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 // 3 -> uParam is ActorID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 // uNumAlive: 0 -> all must be alive
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 unsigned int uAliveActors; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 int v5; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 unsigned int uTotalActors; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 uTotalActors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 if ( uType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 if ( uType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 uAliveActors = SearchActorByGroup(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 if ( uType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 uAliveActors = SearchActorByMonsterID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 if ( uType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 uAliveActors = SearchActorByID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 uAliveActors = SearchAliveActors(&uTotalActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 if ( uNumAlive )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 LOBYTE(v5) = (signed int)uAliveActors >= (signed int)uNumAlive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 LOBYTE(v5) = uTotalActors == uAliveActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 //----- (004466C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 bool __thiscall sub_4466C4(void *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 char *v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 signed int v8; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 Player *v10; // [sp+8h] [bp-10h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 signed int v11; // [sp+Ch] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 signed int v12; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 void *v13; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 if ( !_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 v3 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 pSomeOtherEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 memcpy(pSomeOtherEVT_Events, pGlobalEVT_Events, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 if ( (signed int)uSomeOtherEVT_NumEvents <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 if ( (void *)pSomeOtherEVT_Events[v1].uEventID == v13 && pSomeOtherEVT_Events[v5].field_4 == v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 v6 = pSomeOtherEVT_Events[v5].uEventOffsetInEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 v7 = &pSomeOtherEVT[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 v10 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 v8 = (unsigned __int8)v7[7]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 + (((unsigned __int8)v7[8] + (((unsigned __int8)v7[9] + ((unsigned __int8)v7[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 LOBYTE(v9) = v10->CompareVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 (enum VariableType)((unsigned __int8)pSomeOtherEVT[v6 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 + ((unsigned __int8)pSomeOtherEVT[v6 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 if ( (signed int)v10 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 v12 = (unsigned __int8)v7[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] != 52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 || !IsActorAlive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 (unsigned __int8)v7[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 (unsigned __int8)v7[6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 + (((unsigned __int8)v7[7] + (((unsigned __int8)v7[8] + ((unsigned __int8)v7[9] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 (unsigned __int8)v7[10]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 v1 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 v3 = (unsigned __int8)pSomeOtherEVT[v6 + 11] - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 while ( v1 < (signed int)uSomeOtherEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 result = v12 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 result = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 //----- (0044684A) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16990 void __fastcall EventProcessor(int uEventID, int a2, int a3)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 unsigned int v3; // eax@5
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16993 //signed int v4; // esi@7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16994 //char *v5; // eax@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16995 Player *v6; // ecx@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16996 //char *v7; // ebp@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16997 //signed int v8; // edx@10
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16998 //int v9; // edi@12
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16999 //ByteArray *v10; // esi@12
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 int v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 char *v12; // eax@15
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17002 //char *v13; // edi@21
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 int v14; // ebp@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 int v15; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 const char *v16; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 bool v17; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 int v18; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 int v19; // ebp@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 signed int v20; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 int v21; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 int v22; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 int v23; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 unsigned __int16 v24; // ax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 int v25; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 LevelDecoration *v26; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 int v28; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 int v30; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 int v31; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 int v32; // esi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 NPCData *v33; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 int v34; // esi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 int v35; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 int v36; // esi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 int v37; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 int v38; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 int v39; // ecx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 size_t v40; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 char *v41; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 int v42; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032 int v43; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 size_t v44; // edx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 char *v45; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 void *v46; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 GUIWindow *v47; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 GUIButton *v48; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 GUIButton *v49; // esi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 char v50; // al@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 Player *v51; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 Player *v52; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 int v53; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 char v54; // al@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 Player *v55; // esi@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 Player *v56; // ecx@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 int v57; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 signed int v58; // ebp@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 Player *v59; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 int v60; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 int v61; // edx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 int v62; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 void *v63; // ebp@145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 signed int v64; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 unsigned int v65; // edx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 Player *v66; // ecx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 int v67; // esi@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 signed int v68; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 int v69; // esi@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 Player *v70; // ecx@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 unsigned int v71; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 int v72; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 signed int v73; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 int v74; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 int v75; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 Player *v76; // esi@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 signed int v77; // ebp@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 int v78; // edx@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 Player *v79; // esi@187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 signed int v80; // ebp@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 int v81; // edx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 Player *v82; // esi@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072 int v83; // eax@212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 int v84; // ebp@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 signed int v85; // ebp@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 char v86; // al@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 Player *v87; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 Player *v88; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 int v89; // ecx@232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 int v90; // eax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 const char *v91; // ecx@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 int v92; // eax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 char *v93; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 int v94; // ecx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 int v95; // ebp@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 int v96; // edx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 int v97; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 unsigned int v98; // edx@265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 const char *v99; // esi@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 int v100; // edx@267
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17090 //char *v101; // edi@281
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 unsigned int v102; // esi@281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 int v103; // edi@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 int v104; // eax@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 int v105; // edx@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 int v106; // [sp-20h] [bp-4C8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 signed int v107; // [sp-1Ch] [bp-4C4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 unsigned int v108; // [sp-18h] [bp-4C0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 signed int v109; // [sp-14h] [bp-4BCh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 signed int v110; // [sp-10h] [bp-4B8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 int v111; // [sp-Ch] [bp-4B4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 Event *v112; // [sp-8h] [bp-4B0h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102 int v113; // [sp-8h] [bp-4B0h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 int v114; // [sp-8h] [bp-4B0h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 signed int v115; // [sp-8h] [bp-4B0h]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 unsigned int v116; // [sp-8h] [bp-4B0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 int v117; // [sp-4h] [bp-4ACh]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 int v118; // [sp-4h] [bp-4ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 int v119; // [sp-4h] [bp-4ACh]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 int v120; // [sp-4h] [bp-4ACh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 int v121; // [sp-4h] [bp-4ACh]@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 int v122; // [sp+10h] [bp-498h]@4
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17112 //char *v123; // [sp+14h] [bp-494h]@0
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17113 //signed int v124; // [sp+18h] [bp-490h]@7
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 signed int v125; // [sp+1Ch] [bp-48Ch]@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 int v126; // [sp+1Ch] [bp-48Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 int v127; // [sp+20h] [bp-488h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 int v128; // [sp+24h] [bp-484h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 int v129; // [sp+24h] [bp-484h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 signed int v130; // [sp+28h] [bp-480h]@0
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17120 //int v131; // [sp+2Ch] [bp-47Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 int v132; // [sp+30h] [bp-478h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 signed int v133; // [sp+34h] [bp-474h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 int v134; // [sp+38h] [bp-470h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 int v135; // [sp+3Ch] [bp-46Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 int v136; // [sp+40h] [bp-468h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 int v137; // [sp+44h] [bp-464h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 int v138; // [sp+48h] [bp-460h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 int v139; // [sp+4Ch] [bp-45Ch]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 ItemGen item; // [sp+50h] [bp-458h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 char Source[120]; // [sp+74h] [bp-434h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 char Str[120]; // [sp+ECh] [bp-3BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 Actor Dst; // [sp+164h] [bp-344h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17134 //v131 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 dword_5B5920 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 dword_5B65C4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17142 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 v127 = 2 * (uActiveCharacter == 0) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 v122 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17146 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17148 v3 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 pSomeEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 v112 = pGlobalEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 v3 = uLevelEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 pSomeEVT = pLevelEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 v112 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17158 uSomeEVT_NumEvents = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17159 memcpy(pSomeEVT_Events, v112, 0xCE40u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17160 //v4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17161 //v124 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17162 for (uint i = 0; i < uSomeEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17163 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17164 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17165 //v6 = v123;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17166 //v7 = nullstring;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17167 //while ( 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17168 //{
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 if ( dword_5B65C4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 goto LABEL_301;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17171 //v8 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17172 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
17173 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17174 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17175 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17176 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17177
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17178 switch (_evt->v4)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 case EVENT_CheckSeason:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17181 if ( !sub_4465DF_check_season(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17183 v11 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 case EVENT_ShowMovie:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17186 strcpy(Source, (char *)&_evt->v7);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 if ( *v12 == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 *v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 if ( pVideoPlayer->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 pVideoPlayer->field_40 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17194 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 pAsyncMouse->Suspend();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17196 v128 = pCurrentScreen;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17197 //v13 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17198 //v14 = (unsigned __int8)v13[5];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17199 //v15 = (unsigned __int8)v13[6];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17200 v14 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17201 v15 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 strcpy(Str, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 v16 = RemoveQuotes(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 VideoPlayer::MovieLoop(v16, 0, v14, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205 if ( !_strcmpi(v16, "arbiter good") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 pParty->uAlignment = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17209 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17211 SetUserInterface(v18, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 if ( !_strcmpi(v16, "arbiter evil") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 v18 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17217 pParty->uAlignment = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 if ( !_strcmpi(v16, "pcout01") ) // moving to harmondale from emerald isle
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17222 Rest(0x2760u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 pParty->RestAndHeal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 pParty->field_764 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17226 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 if ( !v15 || v128 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17229 pCurrentScreen = v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 if ( v128 == 3 )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
17231 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 if ( v128 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17235 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 case EVENT_CheckSkill:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17239 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17241 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17242 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17244 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17250 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 v20 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17257 v21 = 3486 * v130 + _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17258 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17259 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 v137 = v21 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 v138 = v21 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 v22 = v21 & 0x100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 v23 = v21 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 v139 = v22;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17265 while ( v23 < v19 || !*(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 if ( v20 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 LABEL_50:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17272 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 LABEL_47:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17276 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17277 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 v137 = v24 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 v138 = v24 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 v139 = v24 & 0x100;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17284 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 case EVENT_SpeakNPC:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 if ( a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 //Actor::Actor(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17291 memset(&Dst, 0, 0x344u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17292 dword_5B65D0_dialogue_actor_npc_id = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17293 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17294 + ((_evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17295 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 Dst.InitializeDialogue(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17301 bDialogueUI_InitializeActor_NPC_ID = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17302 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 case EVENT_ChangeEvent:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17306 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17309 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = _evt->v5 - 124;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 v26 = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 LOBYTE(v26->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 case EVENT_SetNPCGreeting:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17319 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17320 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 pNPCStats->pNewNPCData[v27].greet = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 case EVENT_SetNPCTopic:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17325 v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17326 v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17327 v31 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17328 v32 = _evt->v9;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 v33 = &pNPCStats->pNewNPCData[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 if ( v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 v34 = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 v35 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 v36 = v35 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 if ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 v37 = v36 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 v33->evtf = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17347 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 v33->evte = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 v33->evtd = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 v33->evtc = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17364 v33->evtb = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17367 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369 v33->bDrawSomeAnim = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17371 if ( v29 == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17373 if ( v30 == 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17377 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17378 if ( EnterHouse((enum HOUSE_TYPE)170) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 pAudioPlayer->StopChannels(-1, -1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17381 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17382 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17383 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17384 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17385 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17386 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17387 ptr_F8B1E8 = pNPCTopics[90].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 case EVENT_NPCSetItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 sub_448518_npc_set_item(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17394 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17395 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17396 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 case EVENT_SetActorItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 Actor::GiveItem(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17400 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17401 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17402 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 case EVENT_SetNPCGroupNews:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17405 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
17406 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 case EVENT_SetActorGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17408 __debugbreak();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17409 *(&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
17410 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 case EVENT_ChangeGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17412 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17413 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 v40 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17415 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 v41 = (char *)&pActors[0].uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 if ( *(int *)v41 == v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 *(int *)v41 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 v41 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 --v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 while ( v40 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 case EVENT_ChangeGroupAlly:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17430 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17431 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 v44 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17433 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 v45 = (char *)&pActors[0].uAlly;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 if ( *((int *)v45 - 1) == v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 *(int *)v45 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 v45 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 --v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 while ( v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 case EVENT_MoveNPC:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17448 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
17449 if ( ptr_507BC0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 v46 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 if ( v46 == (void *)165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17454 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17458 _5C3420_pDecoration = (LevelDecoration *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 if ( EnterHouse((enum HOUSE_TYPE)165) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17462 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 ptr_507BC0 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 v48 = v47->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 v49 = v48->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 pAllocator->FreeChunk(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 v48 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 while ( v49 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 v47 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17476 v47->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 ptr_507BC0->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 ptr_507BC0->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 if ( v46 == (void *)553 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 pVideoPlayer->bLoopPlaying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 case EVENT_Jmp:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17489 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17490 v122 = _evt->v5 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 case EVENT_ShowFace:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17493 v50 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 if ( (unsigned __int8)v50 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17497 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 v53 = (unsigned __int8)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 if ( v50 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17504 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 v52 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 goto LABEL_109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 if ( v50 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17510 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17511 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 v53 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 LABEL_108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 v52 = &pParty->pPlayers[v53];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 LABEL_109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17516 v52->PlayEmotion(v113, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 v51 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17522 v51->PlayEmotion(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 while ( (signed int)v51 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 LABEL_291:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 ++v122;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17528 //v4 = v124;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17529 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17530 //v6 = v123;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17531 //v7 = nullstring;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 case EVENT_CharacterAnimation:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17534 v54 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 if ( (unsigned __int8)v54 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17538 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539 v57 = (unsigned __int8)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17542 if ( v54 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17545 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 v56 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17549 if ( v54 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17552 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 v57 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 v56 = &pParty->pPlayers[v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17556 LABEL_120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17557 v56->PlaySound(v114, v118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17558 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17560 v55 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17561 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17563 v55->PlaySound(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17566 while ( (signed int)v55 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17567 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17568 case EVENT_ForPartyMember:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17569 v127 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17570 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17571 case EVENT_SummonItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17572 sub_42F7EB_DropItemAt(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17573 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17574 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17575 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17576 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17577 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17578 _evt->v25,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17579 _evt->v26,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17580 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17581 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17582 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17583 case EVENT_Compare:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17584 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17585 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17587 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17588 v59 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17589 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17591 LOBYTE(v60) = v59->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17592 (enum VariableType)(_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17593 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17594 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17595 if ( v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17596 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17597 ++v130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17598 ++v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17599 if ( (signed int)v59 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17600 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17602 LABEL_129:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17603 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17604 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17606 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17607 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17608 v61 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17609 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17610 goto LABEL_137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17611 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17613 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17614 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17615 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17616 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17619 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17621 if ( v127 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17622 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17624 v61 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17625 //v5 = pSomeEVT;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17626 LABEL_137:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17627 v6 = &pParty->pPlayers[v61];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17628 LABEL_138:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17629 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17630 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17631 LOBYTE(v62) = ((Player *)v6)->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17632 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17633 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17634 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17635 if ( v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17636 goto LABEL_129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17637 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17638 case EVENT_IsActorAlive:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17639 v62 = IsActorAlive(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17640 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17641 _evt->v6 + ((_evt->v7 + ((_evt->v8 + ((uint)_evt->v9 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17642 _evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17643 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17644 case EVENT_Substract:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17645 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
17646 if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17648 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17649 if ( (void *)pParty->pPickedItem.uItemID == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17651 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17652 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17654 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17655 v66 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17656 v67 = (int)v66->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17657 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17658 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17659 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17661 v66->RemoveItemAtInventoryIndex(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17662 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17664 ++v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17665 v67 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17667 while ( (signed int)v65 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17668 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17669 v69 = (int)&v66->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17670 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17671 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17672 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17674 *(&v66->pEquipment.uOffHand + v68) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17675 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17677 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17678 v69 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17680 while ( v68 < 16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17681 v125 = (signed int)&pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17682 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17684 v70 = *(Player **)v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17685 if ( !v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17687 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17688 v72 = (int)v70->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17689 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17690 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17691 if ( *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17693 v70->RemoveItemAtInventoryIndex(v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17694 goto LABEL_169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17696 ++v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17697 v72 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17699 while ( (signed int)v71 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17700 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17701 v74 = (int)&v70->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17702 while ( !*(int *)v74
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17703 || *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17705 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17706 v74 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17707 if ( v73 >= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17708 goto LABEL_170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17710 *(&v70->pEquipment.uOffHand + v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17711 LABEL_169:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17712 v64 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17714 LABEL_170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17715 v125 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17716 if ( v125 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17717 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17720 v75 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17721 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17723 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17724 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17725 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17727 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17729 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17730 goto LABEL_180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17731 LABEL_183:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17732 ((Player *)v6)->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17733 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17734 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17735 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17737 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17738 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17739 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17740 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17742 LABEL_180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17743 v75 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17744 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17745 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17746 v6 = &pParty->pPlayers[v75];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17747 LABEL_182:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17748 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17749 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17751 v76 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17752 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17753 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17755 v76->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17756 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17757 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17758 ++v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17760 while ( (signed int)v76 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17761 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17762 case EVENT_Set:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17763 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17764 v78 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17765 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17767 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17768 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17769 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17771 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17773 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17774 goto LABEL_194;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17775 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17776 ((Player *)v6)->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17777 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17778 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17779 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17781 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17782 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17783 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17784 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17786 LABEL_194:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17787 v78 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17788 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17789 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17790 v6 = &pParty->pPlayers[v78];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17791 LABEL_196:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17792 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17793 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17795 v79 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17796 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17797 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17799 v79->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17800 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17801 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17802 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17804 while ( (signed int)v79 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17805 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17806 case EVENT_Add:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17807 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17808 v81 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17809 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17811 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17812 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17813 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17815 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17817 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17818 goto LABEL_208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17819 LABEL_211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17820 ((Player *)v6)->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17821 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17822 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17823 goto LABEL_212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17825 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17826 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17827 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17828 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17830 LABEL_208:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17831 v81 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17832 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17833 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17834 v6 = &pParty->pPlayers[v81];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17835 LABEL_210:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17836 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17837 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17839 v82 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17840 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17841 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17843 v82->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17844 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17845 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17846 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17848 while ( (signed int)v82 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17849 LABEL_212:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17850 v83 = _evt->v5 + ((uint)_evt->v6 << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17851 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17852 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17853 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17854 case EVENT_InputString:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17855 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17857 strcpy(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17858 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17859 &pLevelStr[pLevelStrOffsets[_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17860 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17861 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17862 v105 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17863 v121 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17864 LABEL_295:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17865 sub_4451A8_press_any_key(uEventID, v105, v121);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17866 LABEL_301:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17867 if ( v133 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17868 LABEL_302:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17869 OnMapLeave();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17870 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17871 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17872 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17873 if ( !_strcmpi(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17874 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17875 &pLevelStr[pLevelStrOffsets[_evt->v9
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17876 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17877 || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17878 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17879 v11 = _evt->v17;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17880 LABEL_130:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17881 //v124 = -1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17882 LABEL_131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17883 v122 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17885 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17886 case EVENT_RandomGoTo:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17887 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17888 v11 = (unsigned __int8)*(&_evt->v5
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17889 + rand()
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17890 % ((_evt->v5 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17891 + (_evt->v6 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17892 + (_evt->v7 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17893 + (_evt->v8 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17894 + (_evt->v9 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17895 + (_evt->v10 != 0)));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17896 goto LABEL_131;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17897 case EVENT_ReceiveDamage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17898 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17899 v86 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17900 if ( (unsigned __int8)v86 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17901 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17902 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17903 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17904 v89 = (unsigned __int8)v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17905 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17907 if ( v86 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17909 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17910 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17911 v119 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17912 v88 = pPlayers[uActiveCharacter];
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17913 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17914 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17916 if ( v86 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17917 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17918 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17919 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v1 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17920 v89 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17921 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17922 v88 = &pParty->pPlayers[v89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17923 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17924 v88->ReceiveDamage(v115, v119);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17925 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17927 v87 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17928 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17929 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17930 v87->ReceiveDamage(v85, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17931 ++v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17933 while ( (signed int)v87 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17934 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17935 case EVENT_ToggleIndoorLight:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17936 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17937 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17938 case EVENT_SetFacesBit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17939 sub_44892E_set_faces_bit(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17940 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17941 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17942 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17943 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17944 case EVENT_ToggleChestFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17945 Chest::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17946 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17947 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17948 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17949 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17950 case EVENT_ToggleActorFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17951 Actor::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17952 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17953 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17954 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17955 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17956 case EVENT_ToggleActorGroupFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17957 ToggleActorGroupFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17958 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17959 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17960 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17961 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17962 case EVENT_SetSnow:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17963 if ( !_evt->v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17964 pWeather->bRenderSnow = _evt->v6 != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17965 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17966 case EVENT_StatusText:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17967 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17968 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17970 if ( _5C3420_pDecoration == (LevelDecoration *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17972 ptr_F8B1E8 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17973 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17975 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17977 v91 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17978 LABEL_248:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17979 ShowStatusBarString(v91, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17980 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17983 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17985 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17987 v91 = &pLevelStr[pLevelStrOffsets[v90]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17988 goto LABEL_248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17991 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17992 case EVENT_ShowMessage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17993 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17994 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17996 v93 = (&dword_721664)[8 * v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17997 byte_5B0938[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17998 ptr_F8B1E8 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18000 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18002 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18004 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18005 case EVENT_CastSpell:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18006 sub_448DF8_cast_spell(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18007 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18008 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18009 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18010 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18011 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18012 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18013 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18014 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18015 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18016 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18017 case EVENT_SetTexture:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18018 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
18019 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18020 case EVENT_SetSprite:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18021 SetDecorationSprite(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18022 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18023 _evt->v9,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18024 (char *)&_evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18025 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18026 case EVENT_SummonMonsters:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18027 sub_448CF4_spawn_monsters(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18028 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18029 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18030 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18031 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18032 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18033 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18034 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18035 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18036 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18037 case EVENT_MouseOver:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18038 case EVENT_LocationName:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18039 --v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18040 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18041 case EVENT_ChangeDoorState:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18042 sub_449A49_door_switch_animation(_evt->v5, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18043 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18044 case EVENT_OpenChest:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18045 if ( !Chest::Open(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18046 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18047 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18048 case EVENT_MoveToMap:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18049 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18050 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18051 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18052 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18053 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18054 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18055 v96 = _evt->v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18056 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18057 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18058 if ( _evt->v29 || _evt->v30 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18060 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18061 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18062 sub_444839_move_map(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18063 _evt->v29,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18064 _evt->v30,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18065 v135,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18066 v132,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18067 v126,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18068 v129,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18069 v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18070 v134,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18071 (char *)&_evt->v31);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18072 dword_5C3418 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18073 dword_5C341C = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18074 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18075 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18076 _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
18077 _5B65A8_npcdata_uflags_or_other = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18078 _5B65B0_npcdata_rep_or_other = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18079 if ( v129 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18081 v98 = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18083 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18085 v98 = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18086 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18087 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18088 v99 = (char *)&_evt->v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18089 _5B65B8_npcdata_hiword_house_or_other = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18090 dword_5B65BC = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18091 v100 = v94 | v132 | v126 | v95 | v97 | v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18092 dword_5B65C0 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18093 if ( *v99 == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18095 if ( v100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18097 pParty->vPosition.x = v135;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18098 pParty->vPosition.y = v132;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18099 pParty->vPosition.z = v126;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18100 pParty->uFallStartY = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18101 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18102 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18103 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18104 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18105 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18106 v111 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18107 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18108 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18109 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18110 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18111 pParty->sRotationX = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18112 pParty->uFallSpeed = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18113 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18114 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18115 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18116 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18117 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18118 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18119 v106 = 232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18120 LABEL_280:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18121 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18124 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18125 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18126 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18127 sub_44987B(v99, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18128 v133 = 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18129 if ( pCurrentScreen == 13 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18131 if ( uGameState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18133 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18134 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18135 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18136 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18137 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18138 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18139 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18140 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18141 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18142 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18143 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18144 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18145 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18146 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18147 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18148 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18150 goto LABEL_302;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18153 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18154 case EVENT_PlaySound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18155 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18156 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18157 v111 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18158 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18159 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18160 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18161 v107 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18162 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18163 goto LABEL_280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18164 case EVENT_GiveItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18165 item.Reset();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18166 //v101 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18167 v102 = _evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18168 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18169 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18170 if ( v102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18171 item.uItemID = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18172 pParty->SetHoldingItem(&item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18173 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18174 case EVENT_SpeakInHouse:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18175 v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18176 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
18177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18178 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18179 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18180 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18181 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18182 v104 = 187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18183 if ( uCurrentHouse_Animation != 167 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18184 v104 = v103;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
18185 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18186 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18187 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18188 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18189 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18190 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18192 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18193 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18194 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18195 case EVENT_PressAnyKey:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18196 v121 = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18197 v105 = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18198 goto LABEL_295;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18199 case EVENT_Exit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18200 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18202 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18203 //++v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18204 //v124 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18205 //if ( v4 >= (signed int)uSomeEVT_NumEvents )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18206 //goto LABEL_301;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18207 //}
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18213 //----- (0044861E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18214 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18216 unsigned int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18217 unsigned __int16 v3; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18218 signed int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18219 BLVFace *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18220 unsigned int *v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18221 char *v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18222 int v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18223 char *v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18224 ODMFace *v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18225 unsigned int *v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18226 unsigned __int16 v12; // [sp+Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18227 const char *Str2; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18228 unsigned int v14; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18229 signed int v15; // [sp+18h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18230 int v16; // [sp+1Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18231 signed int v17; // [sp+20h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18232 signed int v18; // [sp+20h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18234 Str2 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18235 v14 = uFaceCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18236 if ( uFaceCog )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18238 v2 = pBitmaps_LOD->LoadTexture(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18239 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18240 v12 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18241 if ( v2 != -1 ? (int)&pBitmaps_LOD->pTextures[v2] : 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18242 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
18243 pBitmaps_LOD->pTextures[v2].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2].palette_id1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18245 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18247 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18248 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18250 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18251 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18253 if ( pIndoor->pFaceExtras[v4].sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18255 v5 = &pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18256 if ( BYTE1(v5->uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18258 pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18259 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18260 v6 = (unsigned int *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18261 if ( *(_WORD *)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18263 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18265 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18267 *(_WORD *)v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18268 v7 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18269 v7[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18274 v5->uBitmapID = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18277 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18278 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18280 while ( v17 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18282 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18284 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18286 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18287 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18289 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18290 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18292 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18293 v9 = (char *)&pOutdoor->pBModels[v16].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18294 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18295 if ( (signed int)pOutdoor->pBModels[v16].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18297 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18299 v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18300 if ( v10->sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18302 if ( BYTE1(v10->uFaceAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18304 *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18305 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18306 v11 = (unsigned int *)(*((_DWORD *)v9 + 4) + v8 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18307 if ( *(_WORD *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18309 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18311 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18313 *(_WORD *)v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18314 *(_BYTE *)(*((_DWORD *)v9 + 4) + v8 + 29) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18317 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18319 v10->uTextureID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18322 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18323 v8 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18325 while ( v18 < *((_DWORD *)v9 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18327 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18328 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18330 while ( v15 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18333 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18338
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18339
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18341 //----- (0044882F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18342 void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18344 signed int v3; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18345 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18346 unsigned __int16 v5; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18347 unsigned int v6; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18348 int v7; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18350 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18351 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18352 v6 = uCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18353 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18355 v4 = (char *)&pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18356 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18358 if ( *((_WORD *)v4 + 9) == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18360 if ( pFileName && _strcmpi(pFileName, "0") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18362 v5 = pDecorationList->GetDecorIdByName(pFileName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18363 *((_WORD *)v4 - 1) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18364 pDecorationList->InitializeDecorationSprite((signed __int16)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18366 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18367 *v4 &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18368 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18369 *v4 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18370 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18372 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18373 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18375 while ( v3 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18378
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18379
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18380 //----- (004488B6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18381 unsigned __int16 DecorationList::GetDecorIdByName(const char *pName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18383 DecorationList *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18384 signed int uID; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18385 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18386 unsigned __int16 result; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18387
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18388 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18389 if ( pName && (uID = 1, (signed int)this->uNumDecorations > 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18391 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18392 while ( _strcmpi(pName, v2->pDecorations[v4].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18394 ++uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18395 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18396 if ( uID >= (signed int)v2->uNumDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18397 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18399 result = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18401 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18403 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18404 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18406 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18408
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18409
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18410 //----- (0044892E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18411 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18413 signed int v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18414 signed int v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18415 char *v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18416 int v6; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18417 char *v7; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18418 signed int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18419 ODMFace *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18420 int v10; // [sp+0h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18421 signed int v11; // [sp+4h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18422 int v12; // [sp+8h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18423
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18424 v10 = sCogNumber;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18425 if ( sCogNumber )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18427 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18428 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18430 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18432 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18433 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18435 if ( pIndoor->pFaceExtras[v4].sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18437 v5 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18438 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18439 *(_DWORD *)v5 |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18440 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18441 *(_DWORD *)v5 &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18443 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18444 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18446 while ( v3 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18448 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18450 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18451 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18452 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18453 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18455 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18456 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18458 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18459 v7 = (char *)&pOutdoor->pBModels[v12].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18460 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18461 if ( (signed int)pOutdoor->pBModels[v12].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18463 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18465 v9 = (ODMFace *)(v6 + *((_DWORD *)v7 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18466 if ( v9->sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18468 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18469 v9->uFaceAttributes |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18470 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18471 v9->uFaceAttributes &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18473 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18474 v6 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18476 while ( v8 < *((_DWORD *)v7 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18478 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18479 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18481 while ( v11 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18484 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18485 }
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 //----- (00448A17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18490 void Chest::ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18492 unsigned __int16 *pFlags; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18494 if ( (uChestID & 0x80000000u) == 0 && (signed int)uChestID <= 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18496 pFlags = &pChests[uChestID].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18497 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18498 *pFlags |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18499 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18500 *pFlags &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18503
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18504 //----- (00448A40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18505 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18507 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18509 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18511 pActors[uActorID].uAttributes |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18513 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18515 if ( uFlag == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18516 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
18517 if (pActors[uActorID].uAIState == Disabled )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
18518 pActors[uActorID].uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18520 pActors[uActorID].uAttributes &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18524
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18525 //----- (00448A98) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18526 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18528 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18529 unsigned int v4; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18530 signed int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18531 char *v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18532 size_t v7; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18533 char *v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18534 unsigned __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18536 v4 = uGroupID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18537 v5 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18538 v3 = uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18539 if ( uGroupID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18541 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18543 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18545 v6 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18546 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18548 if ( *((_DWORD *)v6 + 168) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18550 *(_DWORD *)v6 |= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18551 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18553 *((_WORD *)v6 + 70) = Disabled;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18554 ((Actor *)(v6 - 36))->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18557 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18558 v6 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18560 while ( v5 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18563 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18565 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18566 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18568 v8 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18569 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18571 if ( *((_DWORD *)v8 + 133) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18573 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18575 v9 = *(_WORD *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18576 if ( *(_WORD *)v8 != Dead )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18578 if ( v9 != 4 && v9 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18579 *(_WORD *)v8 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18582 *((_DWORD *)v8 - 35) &= ~v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18584 v8 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18585 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18587 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18592
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18593
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18594 //----- (00448B45) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18595 void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18597 if ( bForceHide || GameUI_StatusBar_TimedStringTimeLeft && GetTickCount() >= GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18598 GameUI_StatusBar_TimedStringTimeLeft = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18601 //----- (00448B67) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18602 void __thiscall OnTimer(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18604 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18605 unsigned int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18606 unsigned int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18607 char *v4; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18608 __int16 v5; // ax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18609 int v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18610 unsigned int v7; // ebp@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18611 int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18612 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18613 unsigned __int64 v10; // qax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18614 int v11; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18615 int v12; // [sp+Ch] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18616 unsigned int v13; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18618 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18619 if ( !pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18621 if ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18622 dword_5773C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18623 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18624 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18625 v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18626 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18628 _5773B8_event_timer = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18629 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18630 if ( dword_5B65C8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18632 v4 = (char *)&array_5B5928[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18633 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18635 v5 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18636 if ( *(short *)v4 != (short)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18637 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18638 v7 = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18639 if ( v7 <= v3 && (v7 < v3 || *((int *)v4 - 3) <= v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18641 if ( *((short *)v4 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18643 v8 = 29030400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18645 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18647 if ( *((short *)v4 + 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18649 v8 = 2419200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18651 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18653 v9 = -(*((short *)v4 + 4) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18654 v8 = (v9 & 0x7E900) + 86400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18657 v10 = __PAIR__(v7, *((int *)v4 - 3)) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18658 *((int *)v4 - 3) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18659 *((int *)v4 - 2) = HIDWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18660 if ( HIDWORD(v10) <= v3 && (HIDWORD(v10) < v3 || *((int *)v4 - 3) < v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18662 *((int *)v4 - 3) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18663 *((int *)v4 - 2) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18665 v11 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18666 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18667 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18668 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18669 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18670 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18671 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18673 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18674 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18675 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18676 if ( v12 >= dword_5B65C8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18677 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18678 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18680 if ( v13 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18682 *(short *)v4 = v5 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18683 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18685 v6 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18686 *(short *)v4 = *((short *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18687 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18688 EventProcessor(v6, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18689 dword_597F18 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18690 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18696 //----- (00481D77) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18697 void _outdoor_project(RenderVertexSoft *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18699 double v1; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18700 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18701
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18702 v1 = 1.0 / (v->vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18703 v->flt_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18704 v2 = v1 * (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18705 v->vWorldViewProjX = (double)pViewport->uScreenCenterX - v2 * v->vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18706 v->vWorldViewProjY = (double)pViewport->uScreenCenterY - v2 * v->vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18708
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18709
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18710 //----- (00448CF4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18711 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
18712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18713 __int16 v8; // di@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18714 __int16 v9; // si@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18715 unsigned int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18716 size_t v11; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18717 signed int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18718 char *v13;//Actor_uYawAngle_cr *v13; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18719 AIDirection a3; // [sp+Ch] [bp-50h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18720 AIDirection v15; // [sp+28h] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18721 //SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18722
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18723 v8 = typeindex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18724 v9 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18725
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18726 SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18727 //SpawnPointMM7::SpawnPointMM7(&v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18729 v16.vPosition.x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18730 v16.vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18731 v16.vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18732 v16.uGroup = group;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18733 v16.uRadius = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18734 v16.uKind = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18735 v16.uIndex = v8 + 2 * v9 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18736 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18737 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18739 v11 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18740 SpawnEncounter((MapInfo *)&pMapStats + v10, &v16, 0, count, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18741 memcpy(&v15, Actor::GetDirectionInfo(8 * v11 | AI_OBJECT_ACTOR, 4u, &a3, 1), sizeof(v15));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18742 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18743 if ( (signed int)v11 < (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18745 v13 = (char *)&pActors[v11].uYawAngle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18746 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18748 ((Actor *)((char *)v13 - 154))->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18749 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18750 *(short *)v13/*->uYawAngle*/ = LOWORD(v15.uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18751 *(int *)(v13+666)/*->dword_000334_unique_name*/ = uUniqueName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18752 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18754 while ( v12 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18758
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18759
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18760 //----- (00448DF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18761 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
18762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18763 int v9; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18764 double v10; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18765 double v11; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18766 double v12; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18767 double v13; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18768 int v14; // ST44_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18769 signed int v15; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18770 signed int v16; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18771 char *v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18772 unsigned __int16 v18; // ax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18773 char *v19; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18774 int v20; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18775 signed int v21; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18776 char *v22; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18777 unsigned __int16 v23; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18778 int i; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18779 signed int v25; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18780 char *v26; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18781 unsigned __int16 v27; // ax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18782 int j; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18783 signed int v29; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18784 char *v30; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18785 unsigned __int16 v31; // ax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18786 char *v32; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18787 unsigned __int16 v33; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18788 int v34; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18789 int v35; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18790 unsigned __int64 v36; // qax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18791 SpellBuff *v37; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18792 int v38; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18793 signed __int64 v39; // qax@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18794 int v40; // ebx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18795 int v41; // ebx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18796 int v42; // esi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18797 int v43; // ebx@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18798 int v44; // eax@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18799 unsigned __int16 v45; // si@137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18800 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18801 int v47; // [sp-4h] [bp-B8h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18802 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18803 int v49; // [sp+0h] [bp-B4h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18804 int v50; // [sp+0h] [bp-B4h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18805 int v51; // [sp+4h] [bp-B0h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18806 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18807 float v53; // [sp+14h] [bp-A0h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18808 float v54; // [sp+18h] [bp-9Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18809 int v55; // [sp+28h] [bp-8Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18810 unsigned int yaw; // [sp+30h] [bp-84h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18811 int pitch; // [sp+34h] [bp-80h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18812 //LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18813 int v59; // [sp+A8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18814 int v60; // [sp+ACh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18815 int spellnum_; // [sp+B0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18816 signed int levela; // [sp+BCh] [bp+8h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18817 int a6_4; // [sp+C8h] [bp+14h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18818 float a7a; // [sp+CCh] [bp+18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18819 signed int a7b; // [sp+CCh] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18820 int a7c; // [sp+CCh] [bp+18h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18821 int a7d; // [sp+CCh] [bp+18h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18822 float a8a; // [sp+D0h] [bp+1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18823 int a8b; // [sp+D0h] [bp+1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18824 int a8c; // [sp+D0h] [bp+1Ch]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18825 float toza; // [sp+D4h] [bp+20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18826
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18827 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18828 v59 = rank + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18829 spellnum_ = spellnum;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18830 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18831 if ( tox || toy || toz )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18833 v10 = (double)tox - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18834 v53 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18835 v11 = (double)toy - (double)fromy;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18836 v54 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18837 v12 = (double)toz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18839 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18841 v10 = (double)pParty->vPosition.x - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18842 v53 = v10;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18843 v11 = (double)pParty->vPosition.y - (double)fromy;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18844 v54 = v11;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18845 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18847 a7a = v12 - (double)fromz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18848 toza = v11 * v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18849 a8a = v10 * v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18850 v13 = sqrt(a7a * a7a + a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18851 if ( v13 <= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18853 LOBYTE(v55) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18854 yaw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18855 pitch = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18857 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18859 v55 = (signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18860 v14 = (signed __int64)sqrt(a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18861 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18862 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18864 v15 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18865 if ( v59 <= 0 || v59 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18866 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18867 a7b = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18868
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18869 LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18870 //LayingItem::LayingItem(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18871
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18872 a1.uItemType = stru_4E3ACC[spellnum_].uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18873 if ( spellnum_ > 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18875 if ( spellnum_ == 69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18876 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18877 if ( spellnum_ != 83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18878 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18879 v40 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18880 if ( v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18882 v41 = v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18883 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18885 v42 = 14400 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18886 v43 = 4 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18887 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18889 if ( v41 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18891 v42 = 18000 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18892 v43 = 5 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18893 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18896 v42 = 10800 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18897 v43 = 3 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18898 LABEL_114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18899 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18900 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18901 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18902 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18903 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18904 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18905 v48 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18906 v46 = a7b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18907 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18908 v37 = &pParty->pPartyBuffs[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18909 LABEL_115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18910 v36 = pParty->uTimePlayed + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18911 LABEL_116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18912 v37->Apply(v36, v46, v48, v50, v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18913 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18915 if ( spellnum_ != 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18917 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18919 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18920 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18921 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18922 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18923 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18924 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18925 case 39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18926 case 41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18927 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18928 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18929 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18930 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18931 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18932 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18933 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18934 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18935 while ( (short)a1.uItemType != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18937 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18938 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18939 if ( v16 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18940 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18942 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18943 v18 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18944 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18945 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18946 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18948 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18949 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18950 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18951 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18952 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18953 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18954 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18955 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18956 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18957 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18958 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18959 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18961 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18962 if ( v60 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18964 a8b = a7c / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18965 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18966 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18967 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18968 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18969 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18970 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18972 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18973 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18975 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18977 v22 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18978 while ( (short)a1.uItemType != *(short *)v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18980 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18981 v22 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18982 if ( v21 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18983 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18985 v23 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18987 a1.uObjectDescID = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18988 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18989 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18990 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18991 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18992 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18993 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18994 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18995 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18996 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18997 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18999 a1.uFacing = i + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19000 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19001 (signed __int16)(i + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19002 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19003 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19004 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19006 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19008 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19009 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19010 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19011 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19012 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19013 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19014 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19015 v19 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19016 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19018 if ( (short)a1.uItemType == *(short *)v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19019 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19020 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19021 v19 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19023 while ( v16 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19024 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19025 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19026 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19027 a1.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19028 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19029 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19030 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19031 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19032 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19033 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19034 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19035 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19036 a1.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19037 a1.uFacing = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19038 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19039 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19040 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19041 v47 = pitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19042 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19043 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19044 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19046 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19047 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19048 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19049 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19050 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19051 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19052 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19053 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19054 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19055 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19056 v60 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19057 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19059 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19060 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19061 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19062 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19063 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19064 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19065 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19066 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19067 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19068 v26 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19069 while ( (short)a1.uItemType != *(short *)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19071 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19072 v26 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19073 if ( v25 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19075 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19076 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19077 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19080 v27 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19081 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19082 a1.uObjectDescID = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19083 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19084 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19085 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19086 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19087 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19088 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19089 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19090 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19091 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19092 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19094 a1.uFacing = j + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19095 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19096 (signed __int16)(j + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19097 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19098 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19099 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19101 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19102 case 43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19103 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19104 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19105 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19106 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19107 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19108 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19109 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19110 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19111 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19112 v30 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19113 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19114 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19115 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19117 if ( v15 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19119 v9 = 60 * (level + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19121 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19123 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19125 v9 = 180 * (level + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19127 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19129 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19130 v9 = 240 * (level + 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19134 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19135 v32 = (char *)&pParty->pPlayers[0].pConditions[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19136 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19138 if ( *(_QWORD *)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19139 levela = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19140 v32 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19142 while ( (signed int)v32 < (signed int)&pParty->pHirelings[0].uFlags );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19143 if ( !levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19144 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19145 pParty->pPartyBuffs[8].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19146 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19147 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19148 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19149 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19150 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19151 v33 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19152 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19153 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19154 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19155 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19156 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19157 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19158 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19159 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19160 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19162 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19163 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19164 v9 = 300 * (level + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19165 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19166 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19167 v9 = 900 * (level + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19168 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19169 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19170 v9 = 3600 * (level + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19171 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19173 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19175 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19176 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19177 level = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19178 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19179 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19180 v35 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19181 level = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19182 v60 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19183 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19184 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19185 v34 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19186 level = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19187 v60 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19188 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19190 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19191 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19192 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19193 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19194 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19195 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19196 v48 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19197 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19198 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19199 v37 = &pParty->pPartyBuffs[level];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19200 goto LABEL_116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19201 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19202 if ( v15 == 2 || v15 == 3 || v15 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19203 v38 = 60 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19204 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19205 v38 = 600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19206 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19207 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19208 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19209 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19210 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19211 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19212 v48 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19213 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19214 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19215 v37 = &pParty->pPartyBuffs[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19216 goto LABEL_115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19217 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19218 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19219 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19220 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19221 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19222 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19223 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19225 while ( (short)a1.uItemType != *(short *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19227 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19228 v30 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19229 if ( v29 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19231 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19232 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19233 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19236 v31 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19237 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19238 a1.uObjectDescID = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19239 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19240 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19241 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19242 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19243 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19244 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19245 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19246 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19247 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19248 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19249 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19250 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19251 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19252 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19253 a1.Create(v20, v47, v49, v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19254 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19256 LABEL_117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19257 v44 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19258 a6_4 = 3600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19259 if ( v15 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19261 LABEL_124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19262 v60 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19263 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19265 if ( v15 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19267 v44 = 2 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19268 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19270 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19272 v44 = 3 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19273 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19275 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19277 v44 = 4 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19278 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19280 LABEL_125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19281 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19283 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19284 level = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19285 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19286 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19287 level = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19288 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19289 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19290 level = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19291 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19292 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19293 level = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19294 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19295 case 58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19296 level = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19297 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19298 case 69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19299 level = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19300 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19302 v45 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19303 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19304 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19305 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19306 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19307 pParty->pPartyBuffs[level].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19308 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19309 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19310 v60,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19311 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19312 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19313 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19314 LABEL_138:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19315 if ( levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19316 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19317 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19319 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19321 //----- (0044987B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19322 char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19324 const char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19325 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19326 char *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19327
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19328 v2 = pMapName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19329 v3 = uStartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19330 pAudioPlayer->StopChannels(-1, -1);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19331 pGameLoadingUI_ProgressBar->_443484((GUIProgressBar::Type)0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19332 if ( _strcmpi(pCurrentMapName, v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19333 SaveGame(1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19334 uGameState = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19335 result = strcpy(pCurrentMapName, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19336 uLevel_StartingPointType = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19337 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19339 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19341 //----- (004498D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19342 void __thiscall TeleportToStartingPoint(unsigned int uPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19344 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19345 int v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19346 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19347 unsigned __int16 v4; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19348 signed int v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19349 LevelDecoration *v6; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19350 signed int v7; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19351 int v8; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19352 int v9; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19353 const char *v10; // [sp-4h] [bp-84h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19354 char pName[128]; // [sp+8h] [bp-78h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19355
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19356 if ( uPointType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19358 v1 = uPointType - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19359 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19361 v2 = v1 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19362 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19364 v3 = v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19365 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19367 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19368 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19369 v10 = "West Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19371 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19373 v10 = "East Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19376 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19378 v10 = "South Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19381 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19383 v10 = "North Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19386 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19388 v10 = "Party Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19390 strcpy(pName, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19391 v4 = pDecorationList->GetDecorIdByName(pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19392 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19394 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19395 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19397 v6 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19398 while ( v6->uDecorationDescID != (signed __int16)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19400 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19401 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19402 if ( v5 >= (signed int)uNumLevelDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19403 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19405 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19406 pParty->vPosition.x = pLevelDecorations[v7].vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19407 pParty->vPosition.y = pLevelDecorations[v7].vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19408 pParty->vPosition.z = pLevelDecorations[v7].vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19409 pParty->uFallStartY = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19410 v8 = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[v7].field_1A) / 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19411 v9 = pLevelDecorations[v7].field_10_y_rot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19412 pParty->sRotationY = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19413 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19414 pParty->sRotationY = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19415 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19416 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19418 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19419 if ( dword_5B65C0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19421 if ( _5B65A8_npcdata_uflags_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19422 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19423 if ( _5B65AC_npcdata_fame_or_other )
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19424 pParty->vPosition.y = _5B65AC_npcdata_fame_or_other;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19425 if ( _5B65B0_npcdata_rep_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19426 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19427 pParty->vPosition.z = _5B65B0_npcdata_rep_or_other;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19428 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19430 if ( _5B65B4_npcdata_loword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19431 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19432 if ( _5B65B8_npcdata_hiword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19433 pParty->sRotationX = _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19434 if ( dword_5B65BC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19435 pParty->uFallSpeed = dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19437 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19438 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19439 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19440 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19441 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19442 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19443 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19446 // 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19447 // 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19448 // 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19449 // 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19450 // 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19451 // 5B65BC: using guessed type int dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19452 // 5B65C0: using guessed type int dword_5B65C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19453
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19454 //----- (00449A49) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19455 __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19457 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19458 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19459 signed int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19460 int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19461 BLVDoor *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19462 unsigned int v7; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19463 signed int v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19464 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19465 char Args; // [sp+Ch] [bp-78h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19467 LOWORD(v2) = LOWORD(pIndoor->pDoors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19468 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19469 if ( !pIndoor->pDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19470 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19471 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19472 v5 = (int)&pIndoor->pDoors->uDoorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19473 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19475 if ( *(int *)v5 == uDoorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19476 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19477 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19478 v5 += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19480 while ( v4 < 200 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19481 if ( v4 >= 200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19483 sprintfex(&Args, "Unable to find Door ID: %i!", uDoorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19484 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19486 v6 = &pIndoor->pDoors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19487 if ( v3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19489 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19490 if ( (short)v2 == 3 || (short)v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19491 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19492 if ( (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19493 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19495 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19497 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19499 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19500 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19501 if ( (short)v2 && (short)v2 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19502 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19503 v6->uState = BLVDoor::Closing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19504 if ( (short)v2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19506 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19507 v6->uTimeSinceTriggered = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19508 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19510 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19511 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19512 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19514 v8 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19515 v9 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19516 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19517 v2 = (v6->uMoveLength << 7) / v8 - ((signed int)(v7 * v9) / 128 << 7) / v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19518 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19520 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19522 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19524 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19525 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19527 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19528 if ( (short)v2 != 2 && (short)v2 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19529 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19530 v6->uState = BLVDoor::Opening;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19531 if ( !(short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19532 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19533 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19534 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19535 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19537 v8 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19538 v9 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19539 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19541 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19542 v6->uTimeSinceTriggered = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19544 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19547 //----- (00449B57) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19548 unsigned int __fastcall _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19550 return a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19552
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19553 //----- (00449B7E) --------------------------------------------------------
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19554 unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19556 signed int v3; // esi@1
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19557 unsigned char *result; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19558 unsigned int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19559
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19560 v3 = a2 - 1;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19561 result = &pArray[v3 / 8];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19562 v5 = 0x80 >> v3 % 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19563 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19564 *result |= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19565 else
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19566 *result &= ~(unsigned char)v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19567 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19569
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19570
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19571 //----- (0044A56A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19572 void __cdecl sub_44A56A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19574 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19575 NPCData *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19576
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19577 pParty->field_70A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19578 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19579 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19581 v1 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19582 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19584 if ( v1->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v1->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19586 if ( !pParty->pHirelings[1].pName || strcmp(v1->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19587 ++pParty->field_70A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19589 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19590 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19592 while ( v0 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19595
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19596
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19597 //----- (0044C175) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19598 void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19600 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19601 int i; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19603 v2 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19604 strcpy(GameUI_StatusBar_TimedString, pString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19605 GameUI_StatusBar_TimedStringTimeLeft = 1000 * v2 + GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19606 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19607 i > 450;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19608 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19609 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19612 //----- (0044C1D0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19613 void __cdecl ShowNothingHereStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19615 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19616 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19620 //----- (0044C28B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19621 signed int __cdecl const_2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19623 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19626 //----- (0044C28F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19627 bool __cdecl sub_44C28F_open_nwc_dungeon()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19629 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19630
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19631 result = _strcmpi("nwc.blv", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19632 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19634 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19635 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19636 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19637 _5B65B4_npcdata_loword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19638 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19639 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19640 dword_5B65C0 = 0;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19641 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19642 sub_44987B("nwc.blv", 0);
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
19643 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19644 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19646 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19647 }
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19648
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19649
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19650 //----- (0044C2F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19651 int LevelDecoration::IsInteractive()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19653 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19654
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19655 v1 = this->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19656 if ( v1 > 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19658 if ( v1 == 184 || v1 == 187 || v1 == 190 || v1 > 205 && v1 <= 221 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19659 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19661 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19663 if ( v1 == 34 || v1 >= 4 && (v1 <= 6 || v1 == 11 || v1 > 12 && (v1 <= 14 || v1 == 24)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19664 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19666 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19668
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19669 //----- (0044C362) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19670 void Vec3_int_::Normalize_float()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19672 Vec3_int_ *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19673 double v2; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19674 float v3; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19675 double v4; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19676 float v5; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19677 double v6; // st4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19678 float v7; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19679 float v8; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19680 float v9; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19681 double v10; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19682 float v11; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19683 double v12; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19684 float v13; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19685 double v14; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19687 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19688 v2 = (double)this->x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19689 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19690 v4 = (double)this->y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19691 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19692 v6 = (double)this->z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19693 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19694 v8 = 1.0 / sqrt(v6 * v6 + v4 * v4 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19695 v9 = v8 * v3 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19696 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19697 v1->x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19698 v11 = v8 * v5 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19699 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19700 v1->y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19701 v13 = v8 * v7 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19702 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19703 v1->z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19705
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19706 //----- (0044C448) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19707 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19709 GUIFont *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19710 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19711 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19712 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19713 unsigned __int16 **v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19714 GUIFont *v7; // [sp+4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19715 int v8; // [sp+8h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19716 unsigned __int16 **v9; // [sp+Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19718 result = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19719 v3 = pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19720 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19721 v7 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19722 if ( pFontPalette )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19724 v4 = &pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19725 v9 = result->pFontPalettes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19726 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19728 v5 = pIcons_LOD->LoadTexture(v3, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19729 if ( v5 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19730 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
19731 sprintf(pTmpBuf, "Unable to open %s", v3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19732 Abortf(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19734 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19735 v6 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19736 v3 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19737 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19738 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19739 *v6 = (v5 != -1 ? pIcons_LOD->pTextures[v5].pPalette16 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19741 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19742 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19744 result->field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19745 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19747
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19748
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19749
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19750
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19751 //----- (0044C768) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19752 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19754 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19755 GUIFont *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19756 unsigned int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19757 int v9; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19758 unsigned __int8 v10; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19759 int v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19760 GUICharMetric *v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19761 int v13; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19762 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19763 int v15; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19764 unsigned int v16; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19765 unsigned int v17; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19766 unsigned int v18; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19767 int v19; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19768 unsigned __int8 v20; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19769 char v21; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19770 unsigned __int8 v22; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19771 int v23; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19772 unsigned __int8 v24; // dl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19773 int v25; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19774 int v26; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19775 std::string v27; // [sp-18h] [bp-40h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19776 const char *v28; // [sp-8h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19777 int v29; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19778 const char *v30; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19779 char Str[3]; // [sp+10h] [bp-18h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19780 char v32; // [sp+13h] [bp-15h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19781 size_t v33; // [sp+14h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19782 unsigned int v34; // [sp+18h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19783 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19784 int v36; // [sp+20h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19785 int v37; // [sp+24h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19787 v5 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19788 v6 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19789 v30 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19790 v35 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19791 if ( !pInString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19793 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19794 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19796 v33 = strlen(pInString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19797 strcpy(pTmpBuf3, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19798 v8 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19799 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19800 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19801 v34 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19802 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19803 if ( (signed int)v33 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19805 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19807 v10 = pTmpBuf3[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19808 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19809 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19810 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19811 v11 = v10 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19812 v12 = &v6->pMetrics[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19813 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19815 strncpy(Str, &pTmpBuf3[v9 + 1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19816 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19817 v26 = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19818 v8 = uX + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19819 v25 = v9 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19820 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19821 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19823 v13 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19824 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19825 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19826 v14 = v13 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19827 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19829 v25 = v9 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19830 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19831 v37 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19832 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19834 v15 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19835 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19837 if ( v15 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19839 v16 = v12->uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19840 v17 = v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19841 v18 = v12->uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19842 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19844 if ( v37 > v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19845 v8 += v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19846 v8 += v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19847 if ( v37 < (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19848 v8 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19849 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19851 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19853 v19 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19854 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19855 v22 = __OFSUB__(v36, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19856 v20 = v36 == v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19857 v21 = v36 - v37 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19858 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19859 pTmpBuf3[v36] = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19860 v23 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19861 if ( (unsigned __int8)(v21 ^ v22) | v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19863 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19865 v24 = pTmpBuf3[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19866 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19868 if ( v23 > v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19869 v8 += v6->pMetrics[v24].uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19870 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19871 if ( v23 < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19872 v8 += v6->pMetrics[v24].uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19874 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19876 while ( v23 <= v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19879 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19881 v8 += v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19882 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19884 if ( !a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19885 return (char *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19886 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19887 v9 = v37++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19888 if ( v37 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19889 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19891 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19892 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19893 v36 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19894 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19896 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19898
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19899
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19900
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19901
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19902
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19903
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19904
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19907
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19909 //----- (00401000) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19910 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19912 void *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19913 int v5; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19914
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19915 if ( numObjs - 1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19917 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19918 v5 = numObjs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19919 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19921 constructor((int)v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19922 v4 = (char *)v4 + objSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19923 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19925 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19928
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19930 //----- (004014E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19931 int __cdecl ODM_4014E6_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19933 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19934 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19935 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19936 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19937 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19938 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19939 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19940 unsigned int v7; // ST20_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19941 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19942 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19943 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19944 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19945 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19946 int result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19947 int v14; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19948 int v15; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19949 int v16; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19950 unsigned int *v17; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19951 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19952 int i; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19953 char *v20; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19954 int v21; // [sp+Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19955 int v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19956 int v23; // [sp+14h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19957 int v24; // [sp+14h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19958 signed int v25; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19959 signed int v26; // [sp+18h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19960 int v27; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19961
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19962 pParty->uFlags &= 0xFFFFFFCFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19963 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19964 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19965 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19967 v0 = (int)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19968 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19970 *(char *)(v0 + 1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19971 if ( ! ((Actor *)(v0 - offsetof(Actor, uAttributes)))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19972 goto LABEL_37;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19973 v22 = abs(pParty->vPosition.z - *(short *)(v0 + 110));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19974 v21 = abs(pParty->vPosition.y - *(short *)(v0 + 108));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19975 v1 = abs(pParty->vPosition.x - *(short *)(v0 + 106));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19976 v2 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19977 v3 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19978 if ( v1 < v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19980 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19981 v1 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19982 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19984 if ( v1 < v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19986 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19987 v1 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19988 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19990 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19992 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19993 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19994 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19996 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19997 v8 = *(short *)(v0 + 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19998 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19999 v23 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20000 if ( v23 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20002 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20003 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20005 if ( v9 < 5632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20007 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20008 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20009 if ( v10 & 0x80000 || ((Actor *)(v0 - offsetof(Actor, uAttributes)))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20011 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20012 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20013 if ( v11 && (double)v23 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20014 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20015 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20016 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20018 *(char *)(v0 + 1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20019 v12 = v27++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20020 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20021 ai_array_4F7DB0_actor_ids[v12] = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20023 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20025 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20026 *(char *)(v0 + 1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20028 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20029 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20031 while ( v25 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20033 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20034 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20036 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20037 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20038 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20039 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20041 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20043 v24 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20044 if ( v15 >= result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20045 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20046 v16 = ai_array_4F75E0[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20047 if ( v16 > ai_array_4F75E0[v15] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20049 v17 = &ai_array_4F7DB0_actor_ids[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20050 v18 = ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20051 ai_array_4F7DB0_actor_ids[v14] = *v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20052 *v17 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20053 v15 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20054 ai_array_4F75E0[v14] = ai_array_4F75E0[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20055 ai_array_4F75E0[v24] = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20057 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20058 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20060 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20061 v15 = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20062 v26 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20064 while ( v15 - 1 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20066 ai_arrays_size = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20067 if ( result > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20069 result = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20070 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20072 for ( i = 0; i < result; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20074 v20 = (char *)&pActors[ai_array_4F7DB0_actor_ids[i]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20075 v20[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20077 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20079 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20080
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20081 //----- (004016FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20082 int __cdecl BLV_4016FA_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20084 char *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20085 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20086 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20087 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20088 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20089 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20090 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20091 unsigned int v7; // ST24_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20092 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20093 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20094 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20095 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20096 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20097 int v13; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20098 int v14; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20099 int v15; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20100 unsigned int *v16; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20101 unsigned int v17; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20102 int v18; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20103 signed int v19; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20104 Actor *v20; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20105 bool v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20106 int v22; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20107 signed int v23; // ebx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20108 char *v24; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20109 signed int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20110 int v26; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20111 int v27; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20112 int j; // edi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20113 unsigned int v29; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20114 int v30; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20115 int v31; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20116 int v32; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20117 signed int v33; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20118 __int64 v34; // qax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20119 char *v35; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20120 int v37; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20121 int v38; // [sp+10h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20122 int v39; // [sp+14h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20123 int v40; // [sp+18h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20124 int v41; // [sp+18h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20125 int i; // [sp+18h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20126 signed int v43; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20127 signed int v44; // [sp+1Ch] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20128 int v45; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20130 pParty->uFlags &= 0xFFFFFFCFu;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20131 v37 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20132 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20133 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20134 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20136 v0 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20137 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20139 v0[1] &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20140 if ( ! ((Actor *)(v0 - 36))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20141 goto LABEL_60;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20142 v39 = abs(pParty->vPosition.z - *((short *)v0 + 55));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20143 v38 = abs(pParty->vPosition.y - *((short *)v0 + 54));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20144 v1 = abs(pParty->vPosition.x - *((short *)v0 + 53));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20145 v2 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20146 v3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20147 if ( v1 < v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20149 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20150 v1 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20151 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20153 if ( v1 < v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20155 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20156 v1 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20157 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20159 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20161 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20162 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20163 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20165 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20166 v8 = *((short *)v0 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20167 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20168 v40 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20169 if ( v40 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20171 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20172 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20174 if ( v9 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20176 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20177 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20178 if ( v10 & 0x80000 || ((Actor *)(v0 - 36))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20180 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20181 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20182 if ( v11 && (double)v40 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20183 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20184 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20185 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20187 v12 = v45++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20188 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20189 ai_array_4F7DB0_actor_ids[v12] = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20191 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20193 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20194 v0[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20196 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20197 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20199 while ( v43 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20201 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20202 if ( v45 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20204 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20205 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20206 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20208 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20210 v41 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20211 if ( v14 >= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20212 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20213 v15 = ai_array_4F75E0[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20214 if ( v15 > ai_array_4F75E0[v14] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20216 v16 = &ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20217 v17 = ai_array_4F7DB0_actor_ids[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20218 ai_array_4F7DB0_actor_ids[v13] = *v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20219 *v16 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20220 v14 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20221 ai_array_4F75E0[v13] = ai_array_4F75E0[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20222 ai_array_4F75E0[v41] = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20224 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20226 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20227 v14 = v44 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20228 v44 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20230 while ( v14 - 1 < v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20232 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20233 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20234 for ( i = 0; v18 < v45; i = v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20236 v20 = &pActors[ai_array_4F7DB0_actor_ids[v18]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20237 if ( v20->uAttributes & 0x8000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20238 || (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
20239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20240 v22 = ai_array_4F7DB0_actor_ids[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20241 v20->uAttributes |= 0x8000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20242 ai_array_4F6638_actor_ids[v19] = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20243 ai_array_4F5E68[v19++] = ai_array_4F75E0[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20244 if ( v19 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20245 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20247 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20249 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20250 ai_arrays_size = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20251 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20253 v24 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20254 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20256 if ( ((Actor *)(v24 - 36))->CanAct() && *((short *)v24 + 61) == v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20258 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20259 if ( v19 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20261 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20262 v26 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20263 v24[1] |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20264 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20265 ai_array_4F6638_actor_ids[v26] = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20267 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20269 while ( ai_array_4F6638_actor_ids[v25] != v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20271 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20272 if ( v25 >= v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20273 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20277 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20278 v24 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20280 while ( v23 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20282 v27 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20283 for ( j = 0; j < v45; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20285 v29 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20286 if ( pActors[v29].uAttributes & 0xC000 && pActors[v29].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20288 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20289 if ( v27 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20291 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20292 v31 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20293 v32 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20294 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20295 ai_array_4F6638_actor_ids[v31] = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20297 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20299 while ( ai_array_4F6638_actor_ids[v30] != ai_array_4F7DB0_actor_ids[j] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20301 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20302 if ( v30 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20303 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20308 v33 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20309 if ( ai_arrays_size > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20311 v33 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20312 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20314 memcpy(ai_array_4F7DB0_actor_ids, ai_array_4F6638_actor_ids, 4 * v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20315 memcpy(ai_array_4F75E0, ai_array_4F5E68, 4 * ai_arrays_size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20316 v34 = (unsigned int)ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20317 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20319 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20321 v35 = (char *)&pActors[ai_array_4F7DB0_actor_ids[HIDWORD(v34)]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20322 v35[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20323 ++HIDWORD(v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20325 while ( SHIDWORD(v34) < (signed int)v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20327 return v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20329 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20330
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20331 //----- (00401A91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20332 void __cdecl sub_401A91_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20334 unsigned int v0; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20335 int v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20336 int v2; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20337 int v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20338 signed int v4; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20339 char *v5; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20340 signed int v6; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20341 __int16 v7; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20342 Player **v8; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20343 Player *pPlayer; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20344 Actor *pActor; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20345 __int16 v11; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20346 unsigned int v12; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20347 signed int v13; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20348 SpellBuff *v14; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20349 unsigned int v15; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20350 char *v16; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20351 unsigned int v17; // edx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20352 unsigned int v18; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20353 unsigned __int16 v19; // ax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20354 int *v20; // esi@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20355 Actor *v21; // ebx@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20356 unsigned __int16 v22; // ax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20357 signed int v23; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20358 unsigned int v24; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20359 signed int v25; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20360 SpellBuff *v26; // esi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20361 unsigned int v27; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20362 unsigned int v28; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20363 unsigned int v29; // eax@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20364 AIDirection *v30; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20365 unsigned __int16 v31; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20366 unsigned int v32; // esi@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20367 int v33; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20368 int v34; // eax@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20369 char v35; // al@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20370 unsigned int v36; // edi@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20371 signed int v37; // eax@154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20372 unsigned __int8 v38; // sf@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20373 unsigned __int8 v39; // of@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20374 signed int v40; // edx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20375 unsigned int v41; // ecx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20376 double v42; // st7@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20377 double v43; // st6@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20378 bool v44; // eax@189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20379 bool v45; // eax@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20380 unsigned __int8 v46; // cl@197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20381 double v47; // st7@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20382 double v48; // st7@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20383 char v49; // zf@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20384 char v50; // zf@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20385 signed int v51; // edx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20386 unsigned int v52; // ecx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20387 __int16 v53; // fps@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20388 unsigned __int8 v54; // c0@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20389 unsigned __int8 v55; // c3@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20390 double v56; // st7@226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20391 AIDirection *v57; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20392 double v58; // st7@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20393 signed int v59; // [sp-18h] [bp-C8h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20394 int v60; // [sp-14h] [bp-C4h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20395 int v61; // [sp-14h] [bp-C4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20396 AIDirection *v62; // [sp-14h] [bp-C4h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20397 signed int v63; // [sp-14h] [bp-C4h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20398 unsigned int v64; // [sp-14h] [bp-C4h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20399 unsigned int v65; // [sp-10h] [bp-C0h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20400 char v66; // [sp-10h] [bp-C0h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20401 AIDirection *v67; // [sp-10h] [bp-C0h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20402 int v68; // [sp-10h] [bp-C0h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20403 AIDirection *v69; // [sp-10h] [bp-C0h]@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20404 int v70; // [sp-10h] [bp-C0h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20405 AIDirection *v71; // [sp-10h] [bp-C0h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20406 AIDirection v72; // [sp+0h] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20407 AIDirection a3; // [sp+1Ch] [bp-94h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20408 AIDirection v74; // [sp+38h] [bp-78h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20409 AIDirection v75; // [sp+54h] [bp-5Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20410 int v76; // [sp+70h] [bp-40h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20411 signed int a1; // [sp+74h] [bp-3Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20412 int v78; // [sp+78h] [bp-38h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20413 AIDirection pDir; // [sp+7Ch] [bp-34h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20414 float v80; // [sp+98h] [bp-18h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20415 int v81; // [sp+9Ch] [bp-14h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20416 int v82; // [sp+A0h] [bp-10h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20417 unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20418 unsigned int v84; // [sp+A8h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20419 signed int a2; // [sp+ACh] [bp-4h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20420
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20421 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20422 ODM_4014E6_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20423 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20424 BLV_4016FA_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20425 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20426 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor && pParty->field_1613C > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20428 if ( pParty->field_1613C > 417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20430 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20432 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20434 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (pParty->sRotationY + rand() % 16 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20435 v1 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20436 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20437 v3 = pParty->sRotationX + v1 % 16 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20438 pParty->sRotationX = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20439 if ( v3 > 128 || (v2 = -128, v3 < -128) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20440 pParty->sRotationX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20441 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20442 pParty->field_1613C -= pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20443 v4 = pParty->field_16140 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20444 if ( pParty->field_1613C <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20446 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20447 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20448 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20450 v5 = (char *)&pActors[0].sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20451 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20453 if ( ((Actor *)(v5 - 40))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20455 v6 = stru_50C198.CalcMagicalDamageToActor((Actor *)(v5 - 40), 5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20456 v7 = *(short *)v5 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20457 *(short *)v5 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20458 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20460 if ( v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20462 Actor::_4030AD(v84, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20464 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20466 Actor::Die(v84);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20467 if ( *((int *)v5 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20468 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[*((short *)v5 + 28)].uExp);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20472 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20473 v5 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20475 while ( (signed int)v84 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20477 v8 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20478 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20480 pPlayer = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20481 if ( !(*v8)->pConditions[14] && !pPlayer->pConditions[15] && !pPlayer->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20482 pPlayer->ReceiveDamage(v4, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20483 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20485 while ( (signed int)v8 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20486 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20488 if ( pTurnEngine->field_1C != v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20489 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20492 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20494 pTurnEngine->_405E14();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20495 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20497 uActorID = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20498 if ( (signed int)uNumActors > (signed int)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20500 LODWORD(v80) = (int)(char *)pActors + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20501 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20503 pActor = (Actor *)(LODWORD(v80) - 176);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20504 v11 = *(unsigned int *)LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20505 v49 = *(unsigned int *)LODWORD(v80) == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20506 dword_4F6E08[uActorID] = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20507 if ( v49 || v11 == 11 || v11 == 19 || *(char *)(LODWORD(v80) - 139) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20508 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20509 if ( !*(short *)(LODWORD(v80) - 136) && v11 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20510 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20511 v84 = *(_QWORD *)(LODWORD(v80) + 84) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20512 v82 = *(_QWORD *)(LODWORD(v80) + 52) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20513 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20514 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20515 v14 = (SpellBuff *)(LODWORD(v80) + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20516 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20518 if ( v13 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20520 v14->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20521 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20523 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20524 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20526 while ( v13 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20527 if ( v84 != v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20528 && SHIDWORD(pActor->pActorBuffs[3].uExpireTime) <= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20529 && (SHIDWORD(pActor->pActorBuffs[3].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20530 || LODWORD(pActor->pActorBuffs[3].uExpireTime) <= v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20531 pActor->uActorHeight = pMonsterList->pMonsters[pActor->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20532 if ( v82 != v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20533 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20534 pActor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20535 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) <= (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20537 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20538 || LODWORD(pActor->pActorBuffs[1].uExpireTime) <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20539 pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20542 if ( SHIDWORD(pActor->pActorBuffs[5].uExpireTime) > (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20543 || SHIDWORD(pActor->pActorBuffs[5].uExpireTime) >= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20544 && LODWORD(pActor->pActorBuffs[5].uExpireTime)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20545 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) > 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20546 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(pActor->pActorBuffs[6].uExpireTime) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20547 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20548 v15 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20549 v16 = (char *)&pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20550 pActor->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20551 v17 = pActor->uCurrentActionTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20552 v18 = pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20553 if ( (signed int)v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20554 *(int *)v16 = v18 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20555 if ( *(int *)v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20556 *(int *)v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20557 if ( (signed int)v17 < pActor->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20558 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20559 v19 = pActor->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20560 if ( v19 == Dying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20562 pActor->uAIState = Dead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20564 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20566 if ( v19 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20568 Actor::_403F58(uActorID, Dying, 256, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20569 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20570 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
20571 pActor->uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20573 pActor->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20574 pActor->uCurrentActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20575 pActor->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20576 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20577 ++uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20578 LODWORD(v80) += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20580 while ( (signed int)uActorID < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20582 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20583 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20585 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20587 uActorID = ai_array_4F7DB0_actor_ids[v78];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20588 v20 = &dword_4F6E08[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20589 v21 = &pActors[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20590 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20591 if ( v21->pMonsterInfo.uHostilityType && !*v20 )
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20592 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20593 a2 = *v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20594 v76 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20595 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20596 v80 = 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20597 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20598 v80 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20599 v22 = v21->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20600 if ( v22 == 4 || v22 == 5 || v22 == 11 || v22 == 19 || v22 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20601 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20602 if ( !v21->sCurrentHP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20603 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20604 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20606 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20607 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20609 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20611 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20612 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20614 if ( (signed __int64)v21->pActorBuffs[1].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20615 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20616 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20617 v82 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20618 if ( (signed __int64)v21->pActorBuffs[2].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20619 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20620 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20621 v81 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20622 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20623 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20624 v26 = v21->pActorBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20625 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20627 if ( v25 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20629 v26->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20630 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20632 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20633 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20635 while ( v25 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20636 if ( v84 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20637 && SHIDWORD(v21->pActorBuffs[3].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20638 && (SHIDWORD(v21->pActorBuffs[3].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20639 || LODWORD(v21->pActorBuffs[3].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20640 v21->uActorHeight = pMonsterList->pMonsters[v21->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20641 if ( v82 != v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20642 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20643 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20644 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) <= (signed int)v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20646 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20647 || LODWORD(v21->pActorBuffs[1].uExpireTime) <= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20648 v21->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[v21->pMonsterInfo.uID].uHostilityType;
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 ( v81 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20652 && SHIDWORD(v21->pActorBuffs[2].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20653 && (SHIDWORD(v21->pActorBuffs[2].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20654 || LODWORD(v21->pActorBuffs[2].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20655 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
20656 v21->uAIState = Removed;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20657 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20659 if ( v21->pActorBuffs[5].uExpireTime || v21->pActorBuffs[6].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20660 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20661 v27 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20662 v28 = v21->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20663 v21->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20664 if ( (signed int)v28 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20665 v21->pMonsterInfo.uRecoveryTime = v28 - v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20666 if ( (v21->pMonsterInfo.uRecoveryTime & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20667 v21->pMonsterInfo.uRecoveryTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20668 v29 = v21->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20669 if ( !(v29 & 0x8000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20670 v21->uAttributes = v29 | 0x8000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20671 a1 = 8 * uActorID | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20672 v30 = Actor::GetDirectionInfo(8 * uActorID | 3, a2, &a3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20673 v49 = v21->pMonsterInfo.uHostilityType == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20674 memcpy(&v75, v30, sizeof(v75));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20675 memcpy(&pDir, &v75, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20676 if ( !v49 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20678 if ( v80 * 307.2 >= (double)(signed int)v75.uDistance
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20679 && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20680 || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 )
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 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20686 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20687 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20688 if ( v21->uAIState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20690 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20691 v35 = stru_50C198.special_ability_use_check(v21, uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20692 stru_50FE08.Add(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20693 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20694 5120,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20695 v21->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20696 v21->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20697 v21->vPosition.z + ((signed int)v21->uActorHeight >> 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20698 v35,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20699 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20700 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20702 if ( v21->uAIState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20704 v34 = v21->pMonsterInfo.uMissleAttack1Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20705 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20706 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20708 if ( v21->uAIState == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20710 v34 = v21->pMonsterInfo.uMissleAttack2Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20711 v66 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20712 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20713 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20714 Actor::_404874(uActorID, &pDir, v34, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20715 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20717 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20718 if ( v21->uAIState == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20719 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20720 if ( v21->uAIState == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20722 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20723 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20724 v33 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20725 LABEL_146:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20726 Actor::_404AC7(uActorID, &pDir, v33, v60, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20728 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20729 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20730 if ( v21->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20731 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20732 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20734 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20735 v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (v21->pMonsterInfo.uID - 1) / 3]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20736 + (pActors[a2 >> 3].pMonsterInfo.uID - 1) / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20738 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20740 v37 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20742 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20743 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20744 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20746 v39 = __OFSUB__(v36, 1024);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20747 v38 = ((v36 - 1024) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20749 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20751 if ( v37 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20753 v39 = __OFSUB__(v36, 2560);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20754 v38 = ((v36 - 2560) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20756 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20758 if ( v37 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20759 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20760 v39 = __OFSUB__(v36, 5120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20761 v38 = ((v36 - 5120) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20764 if ( v38 ^ v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20765 LABEL_257:
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20766 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20767 LABEL_165:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20768 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20770 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20771 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20772 if ( (signed int)v36 >= 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20774 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20775 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20776 goto LABEL_253;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20778 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20779 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20781 if ( v21->pMonsterInfo.uHostilityType != 4 || !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20782 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20783 if ( !(v21->uAttributes & 0x020000) || v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20785 if ( v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20787 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20788 if ( v21->pMonsterInfo.uMovementType != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20789 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20790 Actor::_403EB6(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20791 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20792 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20793 (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20794 &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20796 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20798 if ( v21->pMonsterInfo.uAIType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20800 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20801 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20802 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20804 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20806 if ( v21->pMonsterInfo.uAIType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20807 goto LABEL_185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20808 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20809 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20810 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20812 if ( v43 > v42 && (signed int)v36 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20814 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20815 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20816 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20817 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20818 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20819 Actor::_402968(v41, v40, 0, v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20820 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20824 LABEL_185:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20825 v81 = v36 - v21->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20826 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20827 v81 -= pActors[a2 >> 3].uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20828 if ( v81 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20829 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20830 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20831 v44 = (signed int)v21->pMonsterInfo.uRecoveryTime <= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20832 v21->uAttributes &= 0xFBFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20833 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20834 v49 = v21->pMonsterInfo.uMovementType == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20835 v84 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20836 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20837 v82 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20838 if ( v81 >= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20839 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20840 v45 = stru_50C198.special_ability_use_check(v21, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20841 if ( !v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20843 if ( v21->pMonsterInfo.uMissleAttack1Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20845 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20847 Actor::_403476(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20848 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20850 LABEL_223:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20851 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20852 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20853 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20854 //UNDEF(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20855 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20856 if ( !(v54 | v55) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20857 goto LABEL_219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20858 LABEL_225:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20859 Actor::_402AD7(v32, a2, v32, (signed __int64)v47, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20860 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20862 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20863 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20865 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20867 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20868 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20869 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20870 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20871 goto LABEL_240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20873 goto LABEL_235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20875 goto LABEL_227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20877 if ( v45 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20879 if ( v45 > 1 && v45 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20881 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20882 v46 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20883 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20884 v46 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20885 if ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20887 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20889 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20890 Actor::_403854(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20891 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20892 Actor::_403A60(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20893 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20895 if ( v80 * 307.2 > (double)v81 || v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20897 LABEL_217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20898 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20899 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20900 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20901 LABEL_219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20902 v51 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20903 v64 = (signed __int64)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20904 v52 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20905 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20906 Actor::_403EB6(v52, v51, v64, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20907 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20909 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20910 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20911 goto LABEL_225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20913 v48 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20914 if ( (double)v81 >= v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20916 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20918 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20919 LABEL_215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20920 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20921 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20922 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20923 v63 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20924 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20925 Actor::_402686(v32, a2, v63, v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20926 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20928 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20929 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20930 v70 = (signed __int64)v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20931 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20932 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20933 goto LABEL_237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20935 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20936 goto LABEL_209;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20938 LABEL_241:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20939 if ( !v21->pMonsterInfo.uMovementType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20941 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20942 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20943 LABEL_252:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20944 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20945 v40 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20946 LABEL_253:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20947 Actor::_4032B2(v41, v40, v61, v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20948 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20950 if ( v21->pMonsterInfo.uMovementType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20952 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20953 v61 = 2560;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20954 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20956 if ( v21->pMonsterInfo.uMovementType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20958 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20959 v61 = 5120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20960 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20962 if ( v21->pMonsterInfo.uMovementType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20964 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20965 v61 = 10240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20966 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20968 if ( v21->pMonsterInfo.uMovementType == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20970 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20971 v58 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20972 memcpy(&v74, v57, sizeof(v74));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20973 memcpy(&pDir, &v74, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20974 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20975 v52 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20976 v64 = (signed __int64)v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20977 v51 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20978 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20980 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20982 if ( !v21->pMonsterInfo.uMissleAttack2Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20984 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20985 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20987 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20989 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20990 goto LABEL_215;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20992 LABEL_235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20993 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20994 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20995 v70 = (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20996 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20997 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20998 LABEL_237:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20999 Actor::_40281C(v32, a2, v59, v62, v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21000 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21002 LABEL_227:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21003 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21004 LABEL_209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21005 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21006 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21007 goto LABEL_218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21008 Actor::_403C6C(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21009 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21011 if ( !v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21012 goto LABEL_223;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21013 Actor::_40368B(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21014 LABEL_254:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21015 ++v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21016 if ( v78 >= ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21017 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21019 v65 = v21->pMonsterInfo.uSpellSkillAndMastery1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21020 v60 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21021 v33 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21022 goto LABEL_146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21025
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21028
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21029 //----- (0040261D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21030 int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21032 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21033
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21034 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21035 if ( this->count < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21037 this->pIDs[result] = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21038 this->pXs[this->count] = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21039 this->pYs[this->count] = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21040 this->pZs[this->count] = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21041 this->field_324[this->count] = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21042 this->field_3EC[this->count] = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21043 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21044 this->field_450[this->count++] = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21046 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21050
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21052
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21053 //----- (00402CAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21054 int stru193_math::SinCos(int angle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21055 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21056 int v2; // eax@1
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21057
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21058 //a2: (angle - uIntegerHalfPi) for sin(angle)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21059 // (angle) for cos(angle)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21060
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21061 v2 = uDoublePiMask & angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21062
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21063 if ( v2 > uIntegerPi )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21064 v2 = uIntegerDoublePi - v2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21065 if ( v2 >= uIntegerHalfPi )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21066 return -pCosTable[uIntegerPi - v2];
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21067 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21068 return pCosTable[v2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21071
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21072
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21076
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21077
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21078
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21079
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21080
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21082
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21083
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21084 //----- (00404544) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21085 signed int stru262_TurnBased::_404544()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21087 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21088 TurnBased_QueueElem *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21089 Actor *v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21090 Actor *v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21091 Player *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21092 int v6; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21093 TurnBased_QueueElem *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21094 TurnBased_QueueElem *v8; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21095 int v9; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21096 int v10; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21097 int v11; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21098 int v12; // ST0C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21099 int v13; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21100 int v14; // ST14_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21101 int v15; // ST18_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21102 signed int result; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21103 TurnBased_QueueElem *v17; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21104 int v18; // [sp+20h] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21105 int v19; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21106 int v20; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21107 signed int v21; // [sp+28h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21108 int v22; // [sp+28h] [bp-4h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21110 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21111 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21112 v19 = this->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21113 if ( this->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21115 v2 = this->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21116 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21118 if ( (v2->uPackedID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21120 v3 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21121 v4 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21122 LOBYTE(v4->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21123 if ( !v4->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21125 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21126 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21127 LOBYTE(v3->uAttributes) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21130 if ( (v2->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21132 v5 = &pParty->pPlayers[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21133 if ( v5->pConditions[14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21134 || v5->pConditions[16]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21135 || v5->pConditions[15]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21136 || v5->pConditions[13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21137 || v5->pConditions[12]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21138 || v5->pConditions[2] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21140 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21141 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21144 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21145 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21147 while ( v20 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21149 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21150 if ( v6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21152 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21153 v7 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21154 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21156 v18 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21157 if ( v21 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21159 v8 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21160 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21162 v9 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21163 v10 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21164 if ( v9 < v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21165 || v9 == v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21166 && ((v11 = v8->uPackedID & 7, v11 == 4) && (v7->uPackedID & 7) == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21167 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21169 v12 = v7->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21170 v13 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21171 v14 = v7->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21172 v15 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21173 v7->uPackedID = v8->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21174 v7->field_4 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21175 v7->uActionLength = v8->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21176 v7->field_C = v8->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21177 v8->uPackedID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21178 v8->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21179 v8->uActionLength = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21180 v8->field_C = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21182 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21183 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21185 while ( v18 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21187 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21188 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21189 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21191 while ( v21 - 1 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21193 v1->uActorQueueSize = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21194 result = v1->pQueue[0].uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21195 if ( (v1->pQueue[0].uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21197 result = (result >> 3) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21198 uActiveCharacter = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21199 v1->field_18 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21201 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21203 uActiveCharacter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21204 v1->field_18 &= 0xFFFFFFFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21206 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21207 if ( v1->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21209 v17 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21210 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21212 if ( (v17->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21213 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21214 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21215 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21216 result = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21218 while ( v22 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21220 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21222
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21223 //----- (0040471C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21224 int stru262_TurnBased::_40471C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21226 int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21228 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21230 if ( pTurnEngine->field_4 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21231 result = _406457(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21233 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21236
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21237 //----- (00404828) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21238 LayingItem::LayingItem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21240 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21242 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21243 v1->field_22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21244 v1->uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21245 v1->uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21246 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21247 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21248 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21249 v1->uItemType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21250 v1->uObjectDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21251 v1->field_61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21252 v1->field_60_distance_related_prolly_lod = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21253 v1->field_20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21254 v1->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21255 v1->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21256 v1->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21257 v1->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21258 v1->field_54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21261
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21263 //----- (004059DB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21264 signed int stru262_TurnBased::Start()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21266 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21267 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21268 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21269 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21270 unsigned int v5; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21271 Actor *v6; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21272 unsigned int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21273 unsigned int v8; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21274 unsigned __int8 v9; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21275 unsigned __int8 v10; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21276 unsigned __int8 v11; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21277 char *v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21278 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21279 unsigned __int16 v14; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21280 int v15; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21281 signed __int64 v16; // qax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21282 int v17; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21283 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21284 char *v19; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21285 int v20; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21286 char *v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21287 int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21288 int v23; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21289 char *v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21290 char *v25; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21291 int v26; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21292 int v27; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21293 int v28; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21294 AIDirection v30; // [sp+Ch] [bp-68h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21295 AIDirection v31; // [sp+28h] [bp-4Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21296 AIDirection a3; // [sp+44h] [bp-30h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21297 int v33; // [sp+60h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21298 int *v34; // [sp+64h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21299 int v35; // [sp+68h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21300 int v40; // [sp+6Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21301 unsigned int v37; // [sp+70h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21302
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21303 pTurnEngine->field_18 &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21304 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21305 pEventTimer->TrackGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21306 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21307 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21308 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21309 v40 = (int)pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21310 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21311 dword_50C994 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21312 v1->field_10 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21313 v1->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21314 v1->field_8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21315 v1->field_4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21316 v1->uActorQueueSize = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21317 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21318 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21320 if ( ((Player *)v40)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21322 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21323 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21324 v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21325 pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21327 v40 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21328 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21330 while ( v40 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21331 v35 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21332 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21333 v40 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21334 if ( v40 < v40 + ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21336 v34 = (int *)ai_array_4F7DB0_actor_ids;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21337 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21339 v37 = *v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21340 v5 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21341 v6 = &pActors[v37];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21342 if ( v37 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21344 if ( pActors[v37].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21346 v7 = v6->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21347 if ( v7 & 0x8000 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21349 v8 = dword_4F6E08[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21350 LOBYTE(v7) = v7 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21351 v6->uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21352 v33 = 8 * v5 | OBJECT_Actor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21353 memcpy(&v31, Actor::GetDirectionInfo(8 * v5 | OBJECT_Actor, v8, &a3, 0), sizeof(v31));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21354 memcpy(&v30, &v31, sizeof(v30));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21355 Actor::_403F58(v37, 4, 32, &v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21356 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21357 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21358 v1->pQueue[v1->uActorQueueSize++].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21361 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21363 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21364 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21366 while ( v40 < v4 + ai_arrays_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21367 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21369 v11 = __OFSUB__(v1->uActorQueueSize, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21370 v9 = v1->uActorQueueSize == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21371 v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21372 v37 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21373 v40 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21374 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21376 v12 = (char *)&v1->pQueue[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21377 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21379 v13 = *((int *)v12 - 1) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21380 if ( v13 != OBJECT_Player )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21381 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21382 v14 = pPlayers[(*((int *)v12 - 1) >> 3) + 1]->uTimeToRecovery;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21383 if ( v14 != (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21385 v33 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21386 v16 = (signed __int64)((double)v14 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21387 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21388 *(int *)v12 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21389 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21391 v15 = v37++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21392 *(&a3.uDistance + v15) = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21393 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21394 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21395 v12 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21396 if ( v40 >= v1->uActorQueueSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21397 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21399 if ( v13 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21401 *(int *)v12 = 666;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21402 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21404 v17 = rand() % 99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21405 if ( v17 < 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21407 *(int *)v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21408 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21410 LODWORD(v16) = SHIDWORD(v16) < 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21411 LOBYTE(v16) = SHIDWORD(v16) >= 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21412 LODWORD(v16) = 2 * v16 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21413 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21415 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21416 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21417 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21421 *(&v31.uDistance + v18) = pParty->pPlayers[*(&v1->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21422 v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21423 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21425 while ( (signed int)v18 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21426 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21428 v35 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21429 v34 = (int *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21430 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21432 v40 = (int)v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21433 if ( (signed int)v34 < (signed int)v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21435 v19 = (char *)&v31.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21436 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21438 v20 = *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21439 v33 = 4 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21440 v21 = (char *)(&v31.uDistance + v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21441 v22 = *(int *)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21442 if ( *(int *)v21 < v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21444 *(int *)v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21445 v23 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21446 *(int *)v19 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21447 v24 = (char *)&a3.uDistance + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21448 v25 = (char *)&a3.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21449 v26 = *(int *)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21450 *(int *)v24 = *(unsigned int *)((char *)&a3.uDistance + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21451 *(int *)v25 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21452 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21454 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21456 while ( v40 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21458 v34 = (int *)((char *)v34 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21459 v35 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21461 while ( (signed int)((char *)v34 - 1) < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21462 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21464 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21466 v27 = v2 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21467 v28 = *(&a3.uDistance + v2++);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21468 v11 = __OFSUB__(v2, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21469 v10 = ((v2 - v37) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21470 v1->pQueue[v28].field_4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21472 while ( v10 ^ v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21476 return v1->_404544();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21478