Mercurial > mm7
annotate Vis.cpp @ 1038:39f42990698f
Cleanings
author | Nomad |
---|---|
date | Thu, 23 May 2013 03:29:29 +0200 |
parents | 306ec23b37df |
children | d36681a9e4f8 |
rev | line source |
---|---|
194 | 1 #include <assert.h> |
2 | |
1016 | 3 #include "BSPModel.h" |
0 | 4 #include "Vis.h" |
5 #include "Outdoor.h" | |
6 #include "Game.h" | |
7 #include "Actor.h" | |
8 #include "IndoorCamera.h" | |
1038 | 9 #include "OutdoorCamera.h" |
0 | 10 #include "Viewport.h" |
1038 | 11 #include "Math.h" |
227 | 12 #include "Log.h" |
0 | 13 |
14 #include "mm7_data.h" | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
742
diff
changeset
|
15 #include "MM7.h" |
0 | 16 |
17 | |
194 | 18 static Vis_SelectionList Vis_static_sub_4C1944_stru_F8BDE8; |
19 | |
20 Vis_SelectionFilter vis_sprite_filter_1 = {VisObjectType_Sprite, OBJECT_Decoration, 0, 0, 2}; // 00F93E1C | |
21 Vis_SelectionFilter vis_sprite_filter_2 = {VisObjectType_Sprite, OBJECT_Decoration, 0, 0, 2}; // 00F93E30 | |
22 Vis_SelectionFilter vis_face_filter = {VisObjectType_Face, OBJECT_Any, -1, 0, 0}; // 00F93E44 | |
23 Vis_SelectionFilter vis_door_filter = {VisObjectType_Face, OBJECT_BLVDoor, -1, 0x100000, 0}; // 00F93E58 | |
24 Vis_SelectionFilter vis_sprite_filter_3 = {VisObjectType_Sprite, OBJECT_Decoration, -1, 0, 4}; // 00F93E6C | |
25 Vis_SelectionFilter vis_sprite_filter_4 = {VisObjectType_Any, OBJECT_Item, -1, 0, 0}; // static to sub_44EEA7 | |
0 | 26 |
27 | |
28 | |
29 //----- (004C1026) -------------------------------------------------------- | |
916 | 30 Vis_ObjectInfo *Vis::DetermineFacetIntersection(BLVFace *face, unsigned int a3, float pick_depth) |
0 | 31 { |
32 char *v4; // eax@4 | |
33 signed int v5; // ecx@4 | |
34 RenderVertexSoft pRay[2]; // [sp+20h] [bp-70h]@17 | |
35 int v20; // [sp+84h] [bp-Ch]@10 | |
36 | |
916 | 37 static Vis_SelectionList static_DetermineFacetIntersection_stru_F8FE00; |
38 static_DetermineFacetIntersection_stru_F8FE00.uNumPointers = 0; | |
0 | 39 |
40 static bool _init_flag = false; | |
916 | 41 static RenderVertexSoft static_DetermineFacetIntersection_array_F8F200[64]; |
0 | 42 if (!_init_flag) |
43 { | |
44 _init_flag = true; | |
45 for (uint i = 0; i < 64; ++i) | |
916 | 46 static_DetermineFacetIntersection_array_F8F200[i].flt_2C = 0.0f; |
0 | 47 } |
48 | |
196 | 49 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
0 | 50 { |
196 | 51 if ( (signed int)face->uNumVertices > 0 ) |
0 | 52 { |
742 | 53 for ( int i = 0; i < face->uNumVertices; i++) |
0 | 54 { |
916 | 55 static_DetermineFacetIntersection_array_F8F200[i].vWorldPosition.x = (double)pIndoor->pVertices[face->pVertexIDs[i]].x; |
56 static_DetermineFacetIntersection_array_F8F200[i].vWorldPosition.y = (double)pIndoor->pVertices[face->pVertexIDs[i]].y; | |
57 static_DetermineFacetIntersection_array_F8F200[i].vWorldPosition.z = (double)pIndoor->pVertices[face->pVertexIDs[i]].z; | |
0 | 58 } |
196 | 59 } |
60 } | |
61 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
62 { | |
63 uint bmodel_id = a3 >> 9; | |
64 auto v = (Vec3_int_ *)pOutdoor->pBModels[bmodel_id].pVertices.pVertices; | |
65 for (uint i = 0; i < face->uNumVertices; ++i) | |
66 { | |
916 | 67 static_DetermineFacetIntersection_array_F8F200[i].vWorldPosition.x = v[face->pVertexIDs[i]].x; |
68 static_DetermineFacetIntersection_array_F8F200[i].vWorldPosition.y = v[face->pVertexIDs[i]].y; | |
69 static_DetermineFacetIntersection_array_F8F200[i].vWorldPosition.z = v[face->pVertexIDs[i]].z; | |
0 | 70 } |
71 } | |
196 | 72 else assert(false); |
73 | |
916 | 74 pGame->pIndoorCameraD3D->ViewTransform(static_DetermineFacetIntersection_array_F8F200, face->uNumVertices); |
75 pGame->pIndoorCameraD3D->Project(static_DetermineFacetIntersection_array_F8F200, face->uNumVertices, 1); | |
196 | 76 |
77 //v15 = this; | |
916 | 78 SortVectors_x(static_DetermineFacetIntersection_array_F8F200, 0, face->uNumVertices - 1); |
79 if (static_DetermineFacetIntersection_array_F8F200[0].vWorldViewPosition.x > pick_depth) | |
196 | 80 return nullptr; |
81 | |
82 float screenspace_center_x, | |
83 screenspace_center_y; | |
916 | 84 GetPolygonScreenSpaceCenter(static_DetermineFacetIntersection_array_F8F200, face->uNumVertices, &screenspace_center_x, &screenspace_center_y); |
85 if (IsPolygonOccludedByBillboard(static_DetermineFacetIntersection_array_F8F200, face->uNumVertices, screenspace_center_x, screenspace_center_y)) | |
196 | 86 return nullptr; |
87 | |
88 CastPickRay(pRay, screenspace_center_x, screenspace_center_y, pick_depth); | |
89 | |
90 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
916 | 91 PickOutdoorFaces_Mouse(pick_depth, pRay, &static_DetermineFacetIntersection_stru_F8FE00, &vis_face_filter, true); |
196 | 92 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
916 | 93 PickIndoorFaces_Mouse(pick_depth, pRay, &static_DetermineFacetIntersection_stru_F8FE00, &vis_face_filter); |
196 | 94 else assert(false); |
95 | |
916 | 96 static_DetermineFacetIntersection_stru_F8FE00.create_object_pointers(); |
97 sort_object_pointers(static_DetermineFacetIntersection_stru_F8FE00.object_pointers, 0, static_DetermineFacetIntersection_stru_F8FE00.uNumPointers - 1); | |
98 if (!static_DetermineFacetIntersection_stru_F8FE00.uNumPointers) | |
196 | 99 return nullptr; |
100 | |
916 | 101 if (!static_DetermineFacetIntersection_stru_F8FE00.sub_4C2551(2, a3)) |
196 | 102 return nullptr; |
103 | |
916 | 104 if (static_DetermineFacetIntersection_stru_F8FE00.uNumPointers) |
105 return static_DetermineFacetIntersection_stru_F8FE00.object_pointers[0]; | |
196 | 106 else return nullptr; |
0 | 107 } |
916 | 108 // F91E08: using guessed type char static_DetermineFacetIntersection_byte_F91E08__init_flags; |
0 | 109 |
110 //----- (004C12C3) -------------------------------------------------------- | |
196 | 111 bool Vis::IsPolygonOccludedByBillboard(RenderVertexSoft *vertices, int num_vertices, float x, float y) |
0 | 112 { |
196 | 113 //signed int v5; // esi@1 |
114 //RenderBillboardD3D *v6; // edi@2 | |
115 //double v7; // st7@9 | |
116 //int v8; // edx@9 | |
117 //RenderVertexSoft *v9; // ecx@10 | |
118 //char result; // al@24 | |
119 //Vis *thisa; // [sp+10h] [bp-8h]@1 | |
120 //float thisb; // [sp+10h] [bp-8h]@9 | |
121 //signed int v13; // [sp+14h] [bp-4h]@1 | |
122 //float a3a; // [sp+28h] [bp+10h]@9 | |
123 //float a4a; // [sp+2Ch] [bp+14h]@9 | |
0 | 124 |
196 | 125 int v13 = -1; |
126 //v5 = 0; | |
127 //thisa = this; | |
128 | |
129 //v6 = pRenderer->pBillboardRenderListD3D; | |
130 for (uint i = 0; i < pRenderer->uNumBillboardsToDraw; ++i) | |
82 | 131 { |
196 | 132 auto billboard = pRenderer->pBillboardRenderListD3D + i; |
133 if (IsPointInsideD3DBillboard(billboard, x, y)) | |
0 | 134 { |
196 | 135 if (v13 == -1) |
136 v13 = i; | |
137 else if ((unsigned int)pBillboardRenderList[billboard->uParentBillboardID].sZValue < pBillboardRenderList[pRenderer->pBillboardRenderListD3D[v13].uParentBillboardID].sZValue) | |
138 v13 = i; | |
0 | 139 } |
140 } | |
196 | 141 |
142 if ( v13 == -1 ) | |
143 return false; | |
144 | |
145 //v8 = num_vertices; | |
146 //v7 = 3.4028235e38; | |
147 float min_x = FLT_MAX; | |
148 //a4a = 3.4028235e38; | |
149 float min_y = FLT_MAX; | |
150 //a3a = -3.4028235e38; | |
151 float max_x = -FLT_MAX; | |
152 //thisb = -3.4028235e38; | |
153 float max_y = -FLT_MAX; | |
154 for (uint i = 0; i < num_vertices; ++i) | |
155 { | |
156 //v9 = a1; | |
157 //do | |
158 //{ | |
159 auto v = vertices + i; | |
160 | |
161 if (v->vWorldViewProjX < min_x) | |
162 min_x = v->vWorldViewProjX; | |
163 if (v->vWorldViewProjX > max_x) | |
164 max_x = v->vWorldViewProjX; | |
165 | |
166 if (v->vWorldViewProjY < min_y) | |
167 min_y = v->vWorldViewProjY; | |
168 if (v->vWorldViewProjY > max_y) | |
169 max_y = v->vWorldViewProjY; | |
170 //++v9; | |
171 //--v8; | |
172 //} | |
173 //while ( v8 ); | |
174 } | |
175 | |
176 if (min_x < pRenderer->pBillboardRenderListD3D[v13].pQuards[0].pos.x || pRenderer->pBillboardRenderListD3D[v13].pQuards[0].pos.y > min_y || | |
177 pRenderer->pBillboardRenderListD3D[v13].pQuards[3].pos.x < max_x || pRenderer->pBillboardRenderListD3D[v13].pQuards[1].pos.y < max_y) | |
178 return false; | |
179 | |
180 return true; | |
0 | 181 } |
182 | |
183 //----- (004C1417) -------------------------------------------------------- | |
184 void Vis::GetPolygonCenter(RenderVertexD3D3 *pVertices, unsigned int uNumVertices, float *pCenterX, float *pCenterY) | |
185 { | |
186 static RenderVertexD3D3 unk_F8EA00[64]; | |
187 | |
188 memcpy(unk_F8EA00, pVertices, 32 * uNumVertices); | |
189 | |
190 SortVerticesByX(unk_F8EA00, 0, uNumVertices - 1); | |
191 *pCenterX = (unk_F8EA00[uNumVertices - 1].pos.x - unk_F8EA00[0].pos.x) * 0.5 + unk_F8EA00[0].pos.x; | |
192 | |
193 SortVerticesByY(unk_F8EA00, 0, uNumVertices - 1); | |
194 *pCenterY = (unk_F8EA00[uNumVertices - 1].pos.y - unk_F8EA00[0].pos.y) * 0.5 + unk_F8EA00[0].pos.y; | |
195 } | |
196 | |
197 //----- (004C1495) -------------------------------------------------------- | |
196 | 198 void Vis::GetPolygonScreenSpaceCenter(RenderVertexSoft *vertices, int num_vertices, float *out_center_x, float *out_center_y) |
0 | 199 { |
200 char *v5; // eax@2 | |
201 signed int v6; // ecx@2 | |
202 float *result; // eax@5 | |
203 | |
204 static RenderVertexSoft static_sub_4C1495_array_F8DDF8[64]; | |
205 | |
196 | 206 memcpy(static_sub_4C1495_array_F8DDF8, vertices, 48 * num_vertices); |
0 | 207 |
196 | 208 SortByScreenSpaceX(static_sub_4C1495_array_F8DDF8, 0, num_vertices - 1); |
209 *out_center_x = (static_sub_4C1495_array_F8DDF8[num_vertices - 1].vWorldViewProjX - static_sub_4C1495_array_F8DDF8[0].vWorldViewProjX) * 0.5 + static_sub_4C1495_array_F8DDF8[0].vWorldViewProjX; | |
210 | |
211 SortByScreenSpaceY(static_sub_4C1495_array_F8DDF8, 0, num_vertices - 1); | |
212 *out_center_y = (static_sub_4C1495_array_F8DDF8[num_vertices - 1].vWorldViewProjY - static_sub_4C1495_array_F8DDF8[0].vWorldViewProjY) * 0.5 + static_sub_4C1495_array_F8DDF8[0].vWorldViewProjY; | |
0 | 213 } |
214 | |
215 //----- (004C1542) -------------------------------------------------------- | |
194 | 216 void Vis::PickBillboards_Mouse(float fPickDepth, float fX, float fY, Vis_SelectionList *list, Vis_SelectionFilter *filter) |
0 | 217 { |
194 | 218 for (uint i = 0; i < pRenderer->uNumBillboardsToDraw; ++i) |
0 | 219 { |
916 | 220 auto d3d_billboard = &pRenderer->pBillboardRenderListD3D[i]; |
194 | 221 if (is_part_of_selection((void *)i, filter) && IsPointInsideD3DBillboard(d3d_billboard, fX, fY)) |
0 | 222 { |
194 | 223 if (DoesRayIntersectBillboard(fPickDepth, i)) |
0 | 224 { |
194 | 225 auto billboard = &pBillboardRenderList[d3d_billboard->uParentBillboardID]; |
226 | |
227 list->AddObject((void *)d3d_billboard->uParentBillboardID, VisObjectType_Sprite, billboard->sZValue); | |
0 | 228 } |
229 } | |
230 } | |
231 } | |
232 | |
233 //----- (004C1607) -------------------------------------------------------- | |
234 bool Vis::IsPointInsideD3DBillboard(RenderBillboardD3D *a1, float x, float y) | |
235 { | |
194 | 236 //RenderBillboardD3D *result; // eax@1 |
0 | 237 double v5; // st7@2 |
238 float v6; // ecx@2 | |
239 float v7; // ST00_4@3 | |
240 __int16 v8; // fps@6 | |
241 double v9; // st6@6 | |
242 char v10; // c0@6 | |
243 char v11; // c2@6 | |
244 char v12; // c3@6 | |
245 __int16 v13; // fps@7 | |
246 double v14; // st6@7 | |
247 unsigned __int8 v15; // c0@7 | |
248 char v16; // c2@7 | |
249 unsigned __int8 v17; // c3@7 | |
250 __int16 v18; // fps@8 | |
251 double v19; // st6@8 | |
252 char v20; // c0@8 | |
253 char v21; // c2@8 | |
254 char v22; // c3@8 | |
255 __int16 v23; // fps@9 | |
256 double v24; // st6@9 | |
257 unsigned __int8 v25; // c0@9 | |
258 char v26; // c2@9 | |
259 unsigned __int8 v27; // c3@9 | |
260 float v28; // [sp+4h] [bp-8h]@2 | |
261 float v29; // [sp+8h] [bp-4h]@2 | |
262 float a1a; // [sp+14h] [bp+8h]@2 | |
263 | |
264 if ( a1->uParentBillboardID == -1 ) | |
194 | 265 return false; |
266 | |
267 //result = a1; | |
0 | 268 v5 = a1->pQuards[0].pos.x; |
269 a1a = a1->pQuards[3].pos.x; | |
194 | 270 v6 = a1->pQuards[0].pos.y; |
271 //result = (RenderBillboardD3D *)LODWORD(result->pQuards[1].pos.y); | |
0 | 272 v29 = v6; |
194 | 273 v28 = a1->pQuards[1].pos.y; |
0 | 274 if ( v5 > a1a ) |
275 { | |
276 v7 = v5; | |
194 | 277 //HIWORD(result) = HIWORD(v7); |
0 | 278 v5 = a1a; |
279 a1a = v7; | |
280 } | |
281 if ( v6 > (double)v28 ) | |
282 { | |
194 | 283 //result = (RenderBillboardD3D *)LODWORD(v28); |
0 | 284 v28 = v6; |
194 | 285 v29 = v28; |
0 | 286 } |
287 v9 = x + 1.0; | |
288 //UNDEF(v8); | |
29 | 289 //v10 = v9 < v5; |
290 //v11 = 0; | |
291 //v12 = v9 == v5; | |
292 //BYTE1(result) = HIBYTE(v8);//crash | |
194 | 293 if (v9 >= v5 && |
294 (v14 = x - 1.0, v14<=a1a) &&///*UNDEF(v13),*/ v15 = v14 < a1a, v16 = 0, v17 = v14 == a1a, BYTE1(result) = HIBYTE(v13), v15 | v17) | |
295 (v19 = y + 1.0, v19>=v29) &&///*UNDEF(v18),*/ v20 = v19 < v29, v21 = 0, v22 = v19 == v29, BYTE1(result) = HIBYTE(v18), v19 >= v29) | |
296 (v24 = y - 1.0, v24<=v28))///*UNDEF(v23),*/ v25 = v24 < v28, v26 = 0, v27 = v24 == v28, BYTE1(result) = HIBYTE(v23), v25 | v27) ) | |
297 return true; | |
0 | 298 else |
194 | 299 return false; |
0 | 300 } |
301 | |
302 //----- (004C16B4) -------------------------------------------------------- | |
196 | 303 void Vis::PickIndoorFaces_Mouse(float fDepth, RenderVertexSoft *pRay, Vis_SelectionList *list, Vis_SelectionFilter *filter) |
0 | 304 { |
305 int v5; // eax@1 | |
742 | 306 signed int pFaceID; // edi@2 |
0 | 307 int v8; // ecx@7 |
308 int v9; // eax@7 | |
309 unsigned int *pNumPointers; // eax@7 | |
310 unsigned int v11; // ecx@7 | |
194 | 311 Vis_ObjectInfo *v12; // edi@7 |
0 | 312 RenderVertexSoft a1; // [sp+Ch] [bp-44h]@1 |
742 | 313 BLVFace *pFace; // [sp+3Ch] [bp-14h]@7 |
0 | 314 void *v15; // [sp+40h] [bp-10h]@7 |
315 int v17; // [sp+48h] [bp-8h]@1 | |
196 | 316 |
0 | 317 v5 = 0; |
318 v17 = 0; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
618
diff
changeset
|
319 for ( a1.flt_2C = 0.0; v17 < (signed int)pBspRenderer->num_faces; ++v17 ) |
0 | 320 { |
742 | 321 pFaceID = pBspRenderer->faces[v5].uFaceID; |
322 if ( pFaceID >= 0 ) | |
0 | 323 { |
742 | 324 if ( pFaceID < (signed int)pIndoor->uNumFaces ) |
0 | 325 { |
742 | 326 if ( is_part_of_selection(&pIndoor->pFaces[pFaceID], filter) ) |
0 | 327 { |
742 | 328 if ( !pGame->pIndoorCameraD3D->IsCulled(&pIndoor->pFaces[pFaceID]) ) |
0 | 329 { |
742 | 330 if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, &pIndoor->pFaces[pFaceID], 0xFFFFFFFFu) ) |
0 | 331 { |
742 | 332 pGame->pIndoorCameraD3D->ViewTransform(&a1, 1); |
1029 | 333 v9 = fixpoint_from_float(/*v8, */a1.vWorldViewPosition.x); |
0 | 334 LOWORD(v9) = 0; |
862 | 335 v15 = (void *)((PID(OBJECT_BModel,pFaceID)) + v9); |
194 | 336 pNumPointers = &list->uNumPointers; |
742 | 337 //v16 = 2; |
338 //v11 = list->uNumPointers; | |
339 pFace = &pIndoor->pFaces[pFaceID]; | |
340 v12 = &list->object_pool[list->uNumPointers]; | |
341 v12->object = &pIndoor->pFaces[pFaceID]; | |
194 | 342 v12 = (Vis_ObjectInfo *)((char *)v12 + 4); |
343 v12->object = v15; | |
742 | 344 v12->sZValue = 2; |
0 | 345 ++*pNumPointers; |
346 } | |
347 } | |
348 } | |
349 } | |
350 } | |
351 v5 = v17 + 1; | |
352 } | |
353 } | |
354 | |
355 //----- (004C17CF) -------------------------------------------------------- | |
323 | 356 void Vis::PickOutdoorFaces_Mouse(float fDepth, RenderVertexSoft *pRay, Vis_SelectionList *list, Vis_SelectionFilter *filter, bool only_reachable) |
196 | 357 { |
0 | 358 if (!pOutdoor) |
359 return; | |
196 | 360 |
361 for (uint i = 0; i < pOutdoor->uNumBModels; ++i) | |
0 | 362 { |
323 | 363 int reachable; |
364 if (!IsBModelVisible(i, &reachable)) | |
196 | 365 continue; |
323 | 366 if (!reachable && only_reachable) |
196 | 367 continue; |
368 | |
369 auto bmodel = &pOutdoor->pBModels[i]; | |
370 for (uint j = 0; j < bmodel->uNumFaces; ++j) | |
0 | 371 { |
1025 | 372 //if ( i == 77 && j == 17 )// |
373 //__debugbreak();// | |
916 | 374 auto face = &bmodel->pFaces[j]; |
196 | 375 if (is_part_of_selection(face, filter)) |
0 | 376 { |
196 | 377 BLVFace blv_face; |
378 blv_face.FromODM(face); | |
379 | |
380 RenderVertexSoft intersection; | |
381 if (Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &intersection, &blv_face, i)) | |
0 | 382 { |
916 | 383 pGame->pIndoorCameraD3D->ViewTransform(&intersection, 1); |
1029 | 384 int v13 = fixpoint_from_float(/*v12, */intersection.vWorldViewPosition.x); |
385 v13 &= 0xFFFF0000; | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
742
diff
changeset
|
386 v13 += PID(OBJECT_BModel, j | (i << 6)); |
196 | 387 |
388 list->AddObject(face, VisObjectType_Face, v13); | |
0 | 389 } |
323 | 390 |
391 if (blv_face.uAttributes & 0x80000000) | |
392 face->uAttributes |= FACE_OUTLINED; | |
393 else | |
394 face->uAttributes &= ~FACE_OUTLINED; | |
0 | 395 } |
396 } | |
397 } | |
398 } | |
399 | |
400 //----- (004C1930) -------------------------------------------------------- | |
401 //bool Vis::j_DoesRayIntersectBillboard(float fDepth, unsigned int uD3DBillboardIdx) | |
402 //{return DoesRayIntersectBillboard(fDepth, uD3DBillboardIdx);} | |
403 | |
404 //----- (004C1944) -------------------------------------------------------- | |
295 | 405 int Vis::PickClosestActor(int object_id, unsigned int pick_depth, int a4, int a5, int a6) |
0 | 406 { |
295 | 407 //float v6; // ST00_4@3 |
408 //int result; // eax@4 | |
194 | 409 Vis_SelectionFilter v8; // [sp+18h] [bp-20h]@3 |
295 | 410 //__int64 v9; // [sp+2Ch] [bp-Ch]@3 |
411 //Vis *v14; // [sp+34h] [bp-4h]@1 | |
0 | 412 |
295 | 413 //v14 = this; |
0 | 414 |
194 | 415 static Vis_SelectionList Vis_static_sub_4C1944_stru_F8BDE8; |
295 | 416 |
417 v8.object_type = VisObjectType_Sprite; | |
194 | 418 v8.object_id = object_id; |
0 | 419 v8.field_8 = a6; |
420 v8.field_C = a5; | |
421 v8.field_10 = a4; | |
422 Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers = 0; | |
295 | 423 PickBillboards_Keyboard(pick_depth, &Vis_static_sub_4C1944_stru_F8BDE8, &v8); |
194 | 424 Vis_static_sub_4C1944_stru_F8BDE8.create_object_pointers(Vis_SelectionList::Unique); |
0 | 425 sort_object_pointers( |
194 | 426 Vis_static_sub_4C1944_stru_F8BDE8.object_pointers, |
0 | 427 0, |
428 Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers - 1); | |
295 | 429 |
430 if (!Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers) | |
431 return -1; | |
432 return Vis_static_sub_4C1944_stru_F8BDE8.object_pointers[0]->sZValue; | |
0 | 433 } |
434 | |
435 //----- (004C1A02) -------------------------------------------------------- | |
436 void Vis::_4C1A02() | |
437 { | |
438 RenderVertexSoft v1; // [sp+8h] [bp-C0h]@1 | |
439 RenderVertexSoft v2; // [sp+38h] [bp-90h]@1 | |
440 RenderVertexSoft v3; // [sp+68h] [bp-60h]@1 | |
441 RenderVertexSoft v4; // [sp+98h] [bp-30h]@1 | |
442 | |
443 v4.flt_2C = 0.0; | |
444 v4.vWorldPosition.x = 0.0; | |
445 v4.vWorldPosition.y = 65536.0; | |
446 v4.vWorldPosition.z = 0.0; | |
447 v3.flt_2C = 0.0; | |
448 v3.vWorldPosition.x = 65536.0; | |
449 v3.vWorldPosition.y = 0.0; | |
450 v3.vWorldPosition.z = 0.0; | |
451 memcpy(&v1, &v3, sizeof(v1)); | |
452 v3.flt_2C = 0.0; | |
453 v3.vWorldPosition.x = 0.0; | |
454 v3.vWorldPosition.y = 65536.0; | |
455 v3.vWorldPosition.z = 0.0; | |
456 memcpy(&v2, &v4, sizeof(v2)); | |
457 v4.flt_2C = 0.0; | |
458 v4.vWorldPosition.x = 65536.0; | |
459 v4.vWorldPosition.y = 0.0; | |
460 v4.vWorldPosition.z = 0.0; | |
461 memcpy(&this->stru_200C, &v1, 0x60u); | |
462 memcpy(&v1, &v4, sizeof(v1)); | |
463 memcpy(&v2, &v3, sizeof(v2)); | |
464 memcpy(&this->stru_206C, &v1, 0x60u); | |
465 } | |
466 | |
467 //----- (004C1ABA) -------------------------------------------------------- | |
468 bool Vis::SortVectors_x(RenderVertexSoft *a2, int a3, int a4) | |
469 { | |
470 bool result; // eax@1 | |
471 RenderVertexSoft *v5; // edx@2 | |
472 int v6; // ebx@2 | |
473 int i; // ecx@2 | |
474 int v8; // esi@3 | |
475 int v9; // esi@5 | |
476 RenderVertexSoft *v10; // eax@8 | |
477 RenderVertexSoft v11; // [sp+4h] [bp-6Ch]@8 | |
478 RenderVertexSoft v12; // [sp+34h] [bp-3Ch]@2 | |
479 int v13; // [sp+64h] [bp-Ch]@7 | |
480 Vis *thisa; // [sp+68h] [bp-8h]@1 | |
481 RenderVertexSoft *v15; // [sp+6Ch] [bp-4h]@2 | |
482 | |
483 result = a4; | |
484 thisa = this; | |
485 if ( a4 > a3 ) | |
486 { | |
487 v5 = a2; | |
488 v15 = &a2[a4]; | |
489 v6 = a3 - 1; | |
490 memcpy(&v12, &a2[a4], sizeof(v12)); | |
491 for ( i = a4; ; i = v13 ) | |
492 { | |
493 v8 = (int)&v5[v6].vWorldViewPosition; | |
494 do | |
495 { | |
496 v8 += 48; | |
497 ++v6; | |
498 } | |
499 while ( *(float *)v8 < (double)v12.vWorldViewPosition.x ); | |
500 v9 = (int)&v5[i].vWorldViewPosition; | |
501 do | |
502 { | |
503 v9 -= 48; | |
504 --i; | |
505 } | |
506 while ( *(float *)v9 > (double)v12.vWorldViewPosition.x ); | |
507 v13 = i; | |
508 if ( v6 >= i ) | |
509 break; | |
510 v10 = &v5[i]; | |
511 memcpy(&v11, &a2[v6], sizeof(v11)); | |
512 v5 = a2; | |
513 memcpy(&a2[v6], v10, sizeof(a2[v6])); | |
514 memcpy(v10, &v11, 0x30u); | |
515 } | |
516 memcpy(&v11, &v5[v6], sizeof(v11)); | |
517 memcpy(&v5[v6], v15, sizeof(v5[v6])); | |
518 memcpy(v15, &v11, 0x30u); | |
519 SortVectors_x(v5, a3, v6 - 1); | |
520 SortVectors_x(a2, v6 + 1, a4); | |
521 } | |
522 return true; | |
523 } | |
524 | |
525 //----- (004C1BAA) -------------------------------------------------------- | |
194 | 526 int Vis::get_object_zbuf_val(Vis_ObjectInfo *info) |
0 | 527 { |
194 | 528 switch (info->object_type) |
529 { | |
530 case VisObjectType_Sprite: | |
531 case VisObjectType_Face: | |
532 return info->sZValue; | |
0 | 533 |
194 | 534 default: |
535 MessageBoxW(nullptr, L"Undefined type requested for: CVis::get_object_zbuf_val()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Vis.cpp:1037", 0); | |
536 return -1; | |
0 | 537 } |
538 } | |
539 | |
540 //----- (004C1BF1) -------------------------------------------------------- | |
541 int Vis::get_picked_object_zbuf_val() | |
542 { | |
194 | 543 if (!default_list.uNumPointers) |
544 return -1; | |
0 | 545 |
998 | 546 return get_object_zbuf_val(default_list.object_pointers[0]); |
0 | 547 } |
548 | |
549 //----- (004C1C0C) -------------------------------------------------------- | |
1025 | 550 bool Vis::Intersect_Ray_Face(RenderVertexSoft *pRayStart, RenderVertexSoft *pRayEnd, float *pDepth, RenderVertexSoft *Intersection, BLVFace *pFace, unsigned int pBModelID) |
0 | 551 { |
323 | 552 //BLVFace *v7; // ebx@1 |
553 //bool result; // eax@1 | |
0 | 554 double v9; // st7@3 |
323 | 555 //__int16 v10; // fps@3 |
556 //char v11; // c0@3 | |
557 //char v12; // c2@3 | |
558 //char v13; // c3@3 | |
559 //__int16 v14; // fps@5 | |
560 //char v15; // c0@5 | |
561 //char v16; // c2@5 | |
562 //char v17; // c3@5 | |
1025 | 563 double c1; // st5@6 |
323 | 564 //__int16 v19; // fps@6 |
565 //char v20; // c0@6 | |
566 //char v21; // c2@6 | |
567 //char v22; // c3@6 | |
568 //unsigned __int8 v23; // c0@6 | |
569 //char v24; // c2@6 | |
570 //unsigned __int8 v25; // c3@6 | |
571 //char v26; // zf@6 | |
0 | 572 double v27; // st6@10 |
323 | 573 //__int16 v28; // fps@10 |
574 //unsigned __int8 v29; // c0@10 | |
575 //char v30; // c2@10 | |
576 //unsigned __int8 v31; // c3@10 | |
1025 | 577 double c2; // st7@11 |
578 //Vec2_short_ v33; // ST1E_4@11 | |
0 | 579 Vec3_short_ v34; // ST04_6@11 |
323 | 580 //float a5a; // [sp+30h] [bp+18h]@10 |
581 //float a5b; // [sp+30h] [bp+18h]@13 | |
582 | |
1025 | 583 if (pFace->Portal() || pFace->Invisible()) |
323 | 584 return false; |
585 | |
1025 | 586 int ray_dir_x = pRayEnd->vWorldPosition.x - pRayStart->vWorldPosition.x,//dir_x y z ýòî âåêòîð íàïðàâëåíèÿ |
587 ray_dir_y = pRayEnd->vWorldPosition.y - pRayStart->vWorldPosition.y,//òî÷êà  - òî÷êà À = âåêòîð èç À â  | |
323 | 588 ray_dir_z = pRayEnd->vWorldPosition.z - pRayStart->vWorldPosition.z; |
589 | |
1025 | 590 /*v9 = ray_dir_z * pFace->pFacePlane.vNormal.z |
591 + ray_dir_y * pFace->pFacePlane.vNormal.y//ñêàëÿðíîå ïðîèçâåäåíèå íàïðàâëåíèÿ ëó÷à è íîðìàëè ê ïîëèãîíó | |
592 + ray_dir_x * pFace->pFacePlane.vNormal.x;//= êîñèíóñ óãëà ìåæäó äâóìÿ âåêòîðàìè | |
323 | 593 if (v9 >= 0) // ray faces face's normal ( > 0) or parallel ( == 0) |
1025 | 594 return false;*/ |
323 | 595 |
596 //ray = t dir + start | |
597 //plane = (p - vertex) normal = -d | |
598 // | |
599 // | |
600 //(t dir + start - vertex) normal = -d | |
601 // | |
602 // -d - (start - vertex) norm | |
603 //t = -------------------- | |
604 // dir norm | |
605 | |
606 | |
1025 | 607 /*float dir_mag = sqrtf(ray_dir_x * ray_dir_x + ray_dir_y * ray_dir_y + ray_dir_z * ray_dir_z);//ìîäóëü âåêòîðà |
608 float ndir_x = ray_dir_x / dir_mag,//ndir - íîðìàëèçîâàííîå íàïðàâëåíèå | |
609 ndir_y = ray_dir_y / dir_mag,// ðåçóëüòàòå íîðìàëèçàöèè ïîëó÷àåòñÿ âåêòîð, íàïðàâëåíèå êîòîðîãî ñîâïàäàåò ñ èñõîäíûì, à ìîäóëü ðàâåí åäèíèöå (åäèíè÷íûé âåêòîð). | |
610 ndir_z = ray_dir_z / dir_mag;//×òîáû íîðìàëèçîâàòü ïðîèçâîëüíûé âåêòîð, äîñòàòî÷íî ðàçäåëèòü êàæäûé êîìïîíåíò âåêòîðà íà ìîäóëü âåêòîðà | |
323 | 611 |
1025 | 612 int face_center_x = (pFace->pBounding.x1 + pFace->pBounding.x2) / 2,//óñðåäí¸ííûå êîîðäèíàòû áàóíäèíãà |
613 face_center_y = (pFace->pBounding.y1 + pFace->pBounding.y2) / 2, | |
614 face_center_z = (pFace->pBounding.z1 + pFace->pBounding.z2) / 2; | |
0 | 615 |
1025 | 616 int to_plane_x = pRayStart->vWorldPosition.x - face_center_x,//âåêòîð èç ãëàñ ê ñåðåäèíå ôåéñà |
323 | 617 to_plane_y = pRayStart->vWorldPosition.y - face_center_y, |
1025 | 618 to_plane_z = pRayStart->vWorldPosition.z - face_center_z;*/ |
323 | 619 |
1025 | 620 //float t = /*-pFace->pFacePlane.dist*/ - (to_plane_x * pFace->pFacePlane.vNormal.x + to_plane_y * pFace->pFacePlane.vNormal.y + to_plane_y * pFace->pFacePlane.vNormal.z) / |
621 // (ndir_x * pFace->pFacePlane.vNormal.x + ndir_y * pFace->pFacePlane.vNormal.y + ndir_z * pFace->pFacePlane.vNormal.z);//íàñêîëüêî ñèëüíî ëó÷ èç êàìåðû îòêëîíÿåòñÿ îò ëó÷à äî öåíòðà ôåéñà | |
622 /* if (t <= *pDepth) | |
323 | 623 { |
624 int intersection_x = pRayStart->vWorldPosition.x + ndir_x * t, | |
625 intersection_y = pRayStart->vWorldPosition.y + ndir_y * t, | |
626 intersection_z = pRayStart->vWorldPosition.z + ndir_z * t; | |
627 | |
1025 | 628 if (intersection_x < pFace->pBounding.x1 || intersection_x > pFace->pBounding.x2 || |
629 intersection_y < pFace->pBounding.y1 || intersection_y > pFace->pBounding.y2 || | |
630 intersection_z < pFace->pBounding.z1 || intersection_z > pFace->pBounding.z2) | |
323 | 631 return false; |
632 | |
1025 | 633 pFace->uAttributes |= 0x80000000; |
323 | 634 return true; |
635 } | |
636 | |
1025 | 637 return false;*/ |
323 | 638 |
639 | |
1025 | 640 //c1 = -d-(n*p0) |
641 c1 = -pFace->pFacePlane.dist -(pFace->pFacePlane.vNormal.x * pRayStart->vWorldPosition.x | |
642 + pFace->pFacePlane.vNormal.y * pRayStart->vWorldPosition.y | |
643 + pFace->pFacePlane.vNormal.z * pRayStart->vWorldPosition.z); | |
644 //if (c1 > 0) | |
645 //return false; | |
646 #define EPSILON 0.000001 | |
647 //c2 = n*u | |
648 c2 = pFace->pFacePlane.vNormal.x * ray_dir_y | |
649 + pFace->pFacePlane.vNormal.y * ray_dir_x | |
650 + pFace->pFacePlane.vNormal.z * ray_dir_z; | |
651 if (c2 > -EPSILON && c2 < EPSILON) // ray faces face's normal ( > 0) or parallel ( == 0) | |
323 | 652 return false; |
653 | |
1025 | 654 //t = -d-(n*p0)/n*u |
655 double t = c1 / c2;//òî÷êà ñîïðèêîñíîâåíèÿ | |
656 | |
657 //if (t < 0 || t > 1) | |
658 //return false; | |
323 | 659 |
1025 | 660 // p(t) = p0 + tu; |
661 // p(t) - âåêòîð óêàçûâàþùèé â òî÷êó íà ïëîñêîñòè | |
662 // p0 - íà÷àëî âåêòîðà, òî÷êà íàáëþäàòåëÿ, êàìåðû | |
663 // t - | |
664 // u - âåêòîð íàïðàâëåíèÿ | |
665 Intersection->vWorldPosition.x = pRayStart->vWorldPosition.x + t * ray_dir_y;//12432 < X < 12656 | |
666 Intersection->vWorldPosition.y = pRayStart->vWorldPosition.y + t * ray_dir_x;//-96 < Y < 1088 | |
667 Intersection->vWorldPosition.z = pRayStart->vWorldPosition.z + t * ray_dir_z;//Z == 192 | |
668 | |
669 v34.x = (signed __int64)Intersection->vWorldPosition.x; | |
670 v34.y = (signed __int64)Intersection->vWorldPosition.y; | |
671 v34.z = (signed __int64)Intersection->vWorldPosition.z; | |
323 | 672 |
1025 | 673 if ( !_4C1D2B(pFace, v34, pBModelID) ) |
323 | 674 return false; |
675 | |
676 //a5b = v27; | |
1025 | 677 //*pDepth = t; |
323 | 678 return true; |
0 | 679 } |
680 | |
681 //----- (004C1D2B) -------------------------------------------------------- | |
1025 | 682 bool Vis::_4C1D2B(BLVFace *pFace, Vec3_short_ a2, unsigned int uModelID) |
0 | 683 { |
1025 | 684 //BLVFace *v4; // esi@1 |
0 | 685 int v5; // esi@10 |
686 bool v6; // edi@10 | |
687 int v7; // ecx@12 | |
688 signed int v8; // edx@12 | |
689 signed int v9; // eax@13 | |
690 signed int v10; // ebx@14 | |
691 int v11; // edi@16 | |
692 signed int v12; // ST28_4@18 | |
693 signed __int64 v13; // qtt@18 | |
694 signed int result; // eax@21 | |
695 int v15; // [sp+10h] [bp-Ch]@10 | |
696 signed int v16; // [sp+18h] [bp-4h]@10 | |
697 | |
1025 | 698 //v4 = pFace; |
699 if (a2.x < pFace->pBounding.x1 || a2.x > pFace->pBounding.x2 || | |
700 a2.y < pFace->pBounding.y1 || a2.y > pFace->pBounding.y2 || | |
701 a2.z < pFace->pBounding.z1 || a2.z > pFace->pBounding.z2 ) | |
323 | 702 return false; |
703 | |
1025 | 704 pFace->uAttributes |= 0x80000000; |
705 return true; | |
323 | 706 if (uModelID != -1) |
1025 | 707 _4C2186_BLV_IntersectBModel(pFace, uModelID, |
323 | 708 word_F8BC48_displaced_face_intersect_plane_coords_a, |
709 word_F8BD18_displaced_face_intersect_plane_coords_b, | |
710 &a2, pFace, uModelID); | |
711 else | |
712 _4C1EE5_BLV_IntersectBModel_2((int *)&pFace, (int *)&uModelID, | |
713 word_F8BC48_displaced_face_intersect_plane_coords_a, | |
714 word_F8BD18_displaced_face_intersect_plane_coords_b, | |
715 &a2, pFace); | |
716 | |
1025 | 717 v5 = 2 * pFace->uNumVertices; |
323 | 718 v16 = 0; |
719 word_F8BC48_displaced_face_intersect_plane_coords_a[v5] = word_F8BC48_displaced_face_intersect_plane_coords_a[0]; | |
720 word_F8BD18_displaced_face_intersect_plane_coords_b[v5] = word_F8BD18_displaced_face_intersect_plane_coords_b[0]; | |
721 v15 = 0; | |
722 v6 = word_F8BD18_displaced_face_intersect_plane_coords_b[0] >= (signed int)uModelID; | |
723 if (v5 <= 0) | |
724 return false; | |
725 | |
0 | 726 do |
727 { | |
728 if ( v16 >= 2 ) | |
729 break; | |
730 v7 = 2 * v15; | |
323 | 731 v8 = word_F8BD18_displaced_face_intersect_plane_coords_b[ + v15 + 1]; |
0 | 732 if ( v6 ^ v8 >= (signed int)uModelID ) |
733 { | |
323 | 734 v9 = word_F8BC48_displaced_face_intersect_plane_coords_a[v7/2 + 1]; |
0 | 735 if ( v9 >= (signed int)pFace ) |
736 v10 = 0; | |
737 else | |
738 v10 = 2; | |
323 | 739 v11 = v10 | word_F8BC48_displaced_face_intersect_plane_coords_a[v7/2] < (signed int)pFace; |
0 | 740 if ( v11 != 3 ) |
741 { | |
742 if ( !v11 | |
323 | 743 || (v12 = v9 - word_F8BC48_displaced_face_intersect_plane_coords_a[v7/2], |
0 | 744 LODWORD(v13) = v12 << 16, |
745 HIDWORD(v13) = v12 >> 16, | |
323 | 746 word_F8BC48_displaced_face_intersect_plane_coords_a[v7/2] |
747 + ((signed int)(((unsigned __int64)(v13 / (v8 - word_F8BD18_displaced_face_intersect_plane_coords_b[v7/2]) | |
748 * (signed int)((uModelID - word_F8BD18_displaced_face_intersect_plane_coords_b[v7/2]) << 16)) >> 16) + 32768) >> 16) >= (signed int)pFace) ) | |
0 | 749 ++v16; |
750 } | |
751 } | |
752 ++v15; | |
753 v6 = v8 >= (signed int)uModelID; | |
754 } | |
755 while ( v15 < v5 ); | |
756 result = 1; | |
757 if ( v16 != 1 ) | |
758 LABEL_25: | |
759 result = 0; | |
760 return result; | |
761 } | |
762 | |
763 //----- (004C1EE5) -------------------------------------------------------- | |
764 bool Vis::_4C1EE5_BLV_IntersectBModel_2(int *a1, int *a2, __int16 *a3, __int16 *a4, Vec3_short_ *a5, BLVFace *pFace) | |
765 { | |
1035 | 766 if (pFace->uAttributes & FACE_XY_PLANE) |
767 { | |
768 *a1 = a5->x; | |
769 *a2 = a5->y; | |
770 | |
771 for (uint i = 0; i < pFace->uNumVertices; ++i) | |
772 { | |
773 a3[2 * i] = pFace->pXInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].x; | |
774 a3[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].x; | |
775 | |
776 a4[2 * i] = pFace->pYInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].y; | |
777 a4[2 * i + 1] = pFace->pYInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].y; | |
778 } | |
779 } | |
780 else if (pFace->uAttributes & FACE_XZ_PLANE) | |
781 { | |
782 *a1 = a5->x; | |
783 *a2 = a5->z; | |
0 | 784 |
1035 | 785 for (uint i = 0; i < pFace->uNumVertices; ++i) |
0 | 786 { |
1035 | 787 a3[2 * i] = pFace->pXInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].x; |
788 a3[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].x; | |
789 | |
790 a4[2 * i] = pFace->pZInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].z; | |
791 a4[2 * i + 1] = pFace->pZInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].z; | |
792 } | |
793 } | |
794 else if (pFace->uAttributes & FACE_YZ_PLANE) | |
795 { | |
796 *a1 = a5->y; | |
797 *a2 = a5->z; | |
798 | |
799 for (uint i = 0; i < pFace->uNumVertices; ++i) | |
800 { | |
801 a3[2 * i] = pFace->pYInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].y; | |
802 a3[2 * i + 1] = pFace->pYInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].y; | |
803 | |
804 a4[2 * i] = pFace->pZInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].z; | |
805 a4[2 * i + 1] = pFace->pZInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].z; | |
0 | 806 } |
807 } | |
808 else | |
809 { | |
1035 | 810 assert(false); |
811 return false; | |
0 | 812 } |
1035 | 813 |
814 return true; | |
0 | 815 } |
816 | |
817 //----- (004C2186) -------------------------------------------------------- | |
1025 | 818 bool Vis::_4C2186_BLV_IntersectBModel(BLVFace *pFace, unsigned int ModelID, __int16 *displaced_face_intersect_plane_coords_a, __int16 *displaced_face_intersect_plane_coords_b, Vec3_short_ *a5, BLVFace *face, unsigned int uModelID) |
0 | 819 { |
820 bool result; // eax@1 | |
1025 | 821 //int *v9; // esi@1 |
822 //unsigned int v10; // ecx@1 | |
823 //unsigned int v11; // edx@3 | |
824 //signed int v12; // ecx@4 | |
1038 | 825 //__int16 v13; // si@4 |
826 //__int16 *v14; // ecx@4 | |
0 | 827 unsigned int v15; // edx@8 |
1025 | 828 //signed int v16; // ecx@9 |
0 | 829 __int16 v17; // si@9 |
830 __int16 *v18; // ecx@9 | |
831 unsigned int v19; // edx@12 | |
1025 | 832 //signed int v20; // ecx@13 |
0 | 833 __int16 v21; // si@13 |
834 __int16 *v22; // ecx@13 | |
1025 | 835 //signed int a1a; // [sp+14h] [bp+8h]@1 |
1038 | 836 //__int16 *a5a; // [sp+24h] [bp+18h]@3 |
0 | 837 __int16 *a5b; // [sp+24h] [bp+18h]@8 |
838 __int16 *a5c; // [sp+24h] [bp+18h]@12 | |
839 | |
1025 | 840 //result = (bool)a6; |
841 //v9 = pFace; | |
842 //v10 = pFace->uAttributes; | |
843 //a1a = 0; | |
1038 | 844 if (pFace->uAttributes & FACE_XY_PLANE) |
0 | 845 { |
1025 | 846 pFace->pFacePlane.vNormal.x = a5->x; |
847 pFace->pFacePlane.vNormal.y = a5->y; | |
1038 | 848 |
849 for (int i = 0; i < pFace->uNumVertices; ++i) | |
850 { | |
851 displaced_face_intersect_plane_coords_a[2 * i] = pFace->pXInterceptDisplacements[i] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i]].x; | |
852 displaced_face_intersect_plane_coords_a[i * 2 + 1] = pFace->pXInterceptDisplacements[i + 1] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i + 1]].x; | |
853 | |
854 displaced_face_intersect_plane_coords_b[2 * i] = pFace->pYInterceptDisplacements[i] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i]].y; | |
855 displaced_face_intersect_plane_coords_b[i * 2 + 1] = pFace->pYInterceptDisplacements[i + 1] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i + 1]].y; | |
856 } | |
857 } | |
858 else if (pFace->uAttributes & FACE_XZ_PLANE) | |
859 { | |
860 pFace->pFacePlane.vNormal.x = a5->x; | |
861 pFace->pFacePlane.vNormal.z = a5->z; | |
862 | |
863 for (int i = 0; i < pFace->uNumVertices; ++i) | |
0 | 864 { |
1038 | 865 displaced_face_intersect_plane_coords_a[2 * i] = pFace->pXInterceptDisplacements[i] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i]].x; |
866 displaced_face_intersect_plane_coords_a[i * 2 + 1] = pFace->pXInterceptDisplacements[i + 1] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i + 1]].x; | |
867 | |
868 displaced_face_intersect_plane_coords_b[2 * i] = pFace->pZInterceptDisplacements[i] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i]].z; | |
869 displaced_face_intersect_plane_coords_b[i * 2 + 1] = pFace->pZInterceptDisplacements[i + 1] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i + 1]].z; | |
870 } | |
871 } | |
872 else if (pFace->uAttributes & FACE_YZ_PLANE) | |
873 { | |
874 pFace->pFacePlane.vNormal.y = a5->y; | |
875 pFace->pFacePlane.vNormal.z = a5->z; | |
876 | |
877 for (int i = 0; i < pFace->uNumVertices; ++i) | |
878 { | |
879 displaced_face_intersect_plane_coords_a[2 * i] = pFace->pYInterceptDisplacements[i] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i]].y; | |
880 displaced_face_intersect_plane_coords_a[i * 2 + 1] = pFace->pYInterceptDisplacements[i + 1] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i + 1]].y; | |
881 | |
882 displaced_face_intersect_plane_coords_b[2 * i] = pFace->pZInterceptDisplacements[i] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i]].z; | |
883 displaced_face_intersect_plane_coords_b[i * 2 + 1] = pFace->pZInterceptDisplacements[i + 1] + pOutdoor->pBModels[ModelID].pVertices.pVertices[pFace->pVertexIDs[i + 1]].z; | |
0 | 884 } |
885 } | |
1038 | 886 else assert(false); |
887 | |
888 return true; | |
889 } | |
890 | |
891 | |
892 | |
893 | |
894 | |
895 //----- (0046A0A1) -------------------------------------------------------- | |
896 int UnprojectX(int x) | |
897 { | |
898 int v3; // [sp-4h] [bp-8h]@5 | |
899 | |
900 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
901 { | |
902 if ( pRenderer->pRenderD3D ) | |
903 v3 = pGame->pIndoorCameraD3D->fov; | |
904 else | |
905 v3 = pIndoorCamera->flt_1C_fov; | |
906 } | |
0 | 907 else |
908 { | |
1038 | 909 v3 = pOutdoorCamera->int_fov_rad; |
910 } | |
911 return stru_5C6E00->Atan2(x - pViewport->uScreenCenterX, v3) - stru_5C6E00->uIntegerHalfPi; | |
912 } | |
913 | |
914 //----- (0046A0F6) -------------------------------------------------------- | |
915 int UnprojectY(int y) | |
916 { | |
917 int v3; // [sp-4h] [bp-8h]@5 | |
918 | |
919 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
920 { | |
921 if ( pRenderer->pRenderD3D ) | |
922 v3 = pGame->pIndoorCameraD3D->fov; | |
0 | 923 else |
1038 | 924 v3 = pIndoorCamera->flt_1C_fov; |
0 | 925 } |
1038 | 926 else |
927 { | |
928 v3 = pOutdoorCamera->int_fov_rad; | |
929 } | |
930 return stru_5C6E00->Atan2(y - pViewport->uScreenCenterY, v3) - stru_5C6E00->uIntegerHalfPi; | |
0 | 931 } |
932 | |
933 //----- (004C248E) -------------------------------------------------------- | |
934 void Vis::CastPickRay(RenderVertexSoft *pRay, float fMouseX, float fMouseY, float fPickDepth) | |
935 { | |
1025 | 936 int pRotY; // esi@1 |
937 Vec3_int_ pStartR; // ST08_12@1 | |
938 int pRotX; // ST04_4@1 | |
939 int pDepth; // eax@1 | |
0 | 940 RenderVertexSoft v11[2]; // [sp+2Ch] [bp-74h]@1 |
1025 | 941 int outx; |
0 | 942 int outz; // [sp+94h] [bp-Ch]@1 |
943 int outy; // [sp+98h] [bp-8h]@1 | |
944 | |
1025 | 945 pRotY = pIndoorCamera->sRotationY + UnprojectX((signed __int64)fMouseX); |
946 pStartR.z = pIndoorCamera->pos.z; | |
947 pStartR.x = pIndoorCamera->pos.x; | |
948 pStartR.y = pIndoorCamera->pos.y; | |
949 pRotX = pIndoorCamera->sRotationX + UnprojectY((signed __int64)fMouseY); | |
1029 | 950 pDepth = fixpoint_from_float(fPickDepth); |
1025 | 951 Vec3_int_::Rotate(pDepth, pRotY, pRotX, pStartR, &outx, &outy, &outz); |
952 | |
0 | 953 v11[0].flt_2C = 0.0; |
1025 | 954 v11[0].vWorldPosition.x = (double)outx; |
0 | 955 v11[0].vWorldPosition.y = (double)outy; |
956 v11[0].vWorldPosition.z = (double)outz; | |
1025 | 957 |
0 | 958 v11[1].flt_2C = 0.0; |
1025 | 959 v11[1].vWorldPosition.x = (double)pIndoorCamera->pos.x; |
960 v11[1].vWorldPosition.y = (double)pIndoorCamera->pos.y; | |
961 v11[1].vWorldPosition.z = (double)pIndoorCamera->pos.z; | |
962 | |
0 | 963 memcpy(pRay, &v11[1], 0x30u); |
964 memcpy(&pRay[1], v11, sizeof(pRay[1])); | |
965 } | |
966 | |
967 //----- (004C2551) -------------------------------------------------------- | |
194 | 968 Vis_ObjectInfo *Vis_SelectionList::sub_4C2551(int a2, int a3) |
0 | 969 { |
970 unsigned int v3; // esi@1 | |
971 signed int v4; // edx@1 | |
972 char *v5; // eax@2 | |
194 | 973 Vis_ObjectInfo *result; // eax@6 |
0 | 974 |
975 v3 = this->uNumPointers; | |
976 v4 = 0; | |
977 if ( (signed int)v3 <= 0 ) | |
978 { | |
979 LABEL_6: | |
980 result = 0; | |
981 } | |
982 else | |
983 { | |
194 | 984 v5 = (char *)&this->object_pool[0].sZValue; |
0 | 985 while ( *((int *)v5 + 1) != a2 || (*(int *)v5 & 0xFFFF) != a3 ) |
986 { | |
987 ++v4; | |
988 v5 += 12; | |
989 if ( v4 >= (signed int)v3 ) | |
990 goto LABEL_6; | |
991 } | |
194 | 992 result = &this->object_pool[v4]; |
0 | 993 } |
994 return result; | |
995 } | |
996 | |
997 //----- (004C2591) -------------------------------------------------------- | |
194 | 998 void Vis_SelectionList::create_object_pointers(PointerCreationType type) |
0 | 999 { |
194 | 1000 switch (type) |
1001 { | |
1002 case All: | |
1003 { | |
1004 for (uint i = 0; i < uNumPointers; ++i) | |
1005 object_pointers[i] = &object_pool[i]; | |
1006 } | |
1007 break; | |
0 | 1008 |
194 | 1009 case Unique: // seems quite retarted; the inner if condition will never trigger, since we compare pointers, not values. pointers will always be unique |
1010 { // but it may be decompilation error thou | |
1011 bool create = true; | |
1012 | |
1013 for (uint i = 0; i < uNumPointers; ++i) | |
0 | 1014 { |
194 | 1015 for (uint j = 0; j < i; ++j) |
0 | 1016 { |
194 | 1017 if (object_pointers[j] == &object_pool[i]) |
0 | 1018 { |
194 | 1019 create = false; |
1020 break; | |
0 | 1021 } |
1022 } | |
194 | 1023 |
1024 if (create) | |
1025 object_pointers[i] = &object_pool[i]; | |
0 | 1026 } |
1027 } | |
196 | 1028 break; |
194 | 1029 |
1030 default: | |
0 | 1031 MessageBoxW(nullptr, L"Unknown pointer creation flag passed to ::create_object_pointers()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Vis.cpp:1358", 0); |
1032 } | |
1033 } | |
1034 | |
1035 //----- (004C264A) -------------------------------------------------------- | |
194 | 1036 void Vis::sort_object_pointers(Vis_ObjectInfo **pPointers, int left, int right) |
0 | 1037 { |
1038 int v4; // edx@1 | |
1039 int v5; // ebx@1 | |
1040 int v6; // esi@2 | |
1041 signed int i; // ecx@2 | |
1042 int v8; // eax@3 | |
1043 int v9; // ebx@4 | |
1044 int v10; // ebx@6 | |
194 | 1045 Vis_ObjectInfo *v11; // eax@7 |
0 | 1046 Vis *thisa; // [sp+4h] [bp-4h]@1 |
194 | 1047 Vis_ObjectInfo *a3a; // [sp+14h] [bp+Ch]@2 |
0 | 1048 |
1049 v4 = left; | |
1050 v5 = right; | |
1051 thisa = this; | |
1052 if ( right > left ) | |
1053 { | |
1054 do | |
1055 { | |
1056 v6 = v4 - 1; | |
1057 a3a = pPointers[v5]; | |
1058 for ( i = v5; ; pPointers[i] = v11 ) | |
1059 { | |
1060 v8 = a3a->sZValue; | |
1061 LOWORD(v8) = 0; | |
1062 do | |
1063 { | |
1064 ++v6; | |
1065 v9 = pPointers[v6]->sZValue; | |
1066 LOWORD(v9) = 0; | |
1067 } | |
1068 while ( v9 < (unsigned int)v8 ); | |
1069 do | |
1070 { | |
1071 if ( i < 1 ) | |
1072 break; | |
1073 --i; | |
1074 v10 = pPointers[i]->sZValue; | |
1075 LOWORD(v10) = 0; | |
1076 } | |
1077 while ( v10 > (unsigned int)v8 ); | |
1078 v11 = pPointers[v6]; | |
1079 if ( v6 >= i ) | |
1080 break; | |
1081 pPointers[v6] = pPointers[i]; | |
1082 } | |
1083 v5 = right; | |
1084 pPointers[v6] = pPointers[right]; | |
1085 pPointers[right] = v11; | |
1086 sort_object_pointers(pPointers, v4, v6 - 1); | |
1087 v4 = v6 + 1; | |
1088 } | |
1089 while ( right > v6 + 1 ); | |
1090 } | |
1091 } | |
1092 | |
1093 //----- (004C26D0) -------------------------------------------------------- | |
1094 bool Vis::SortVerticesByX(RenderVertexD3D3 *a2, unsigned int uStart, unsigned int uEnd) | |
1095 { | |
1096 bool result; // eax@1 | |
1097 RenderVertexD3D3 *v5; // edx@2 | |
1098 RenderVertexD3D3 *v6; // esi@2 | |
1099 void *v7; // edi@2 | |
1100 unsigned int v8; // ebx@2 | |
1101 RenderVertexD3D3 *v9; // ecx@3 | |
1102 RenderVertexD3D3 *v10; // ecx@5 | |
1103 RenderVertexD3D3 *v11; // eax@8 | |
1104 RenderVertexD3D3 v12; // [sp+4h] [bp-4Ch]@8 | |
1105 RenderVertexD3D3 v13; // [sp+24h] [bp-2Ch]@2 | |
1106 Vis *thisa; // [sp+44h] [bp-Ch]@1 | |
1107 RenderVertexD3D3 *v15; // [sp+48h] [bp-8h]@2 | |
1108 unsigned int v16; // [sp+4Ch] [bp-4h]@2 | |
1109 | |
1110 result = uEnd; | |
1111 thisa = this; | |
1112 if ( (signed int)uEnd > (signed int)uStart ) | |
1113 { | |
1114 v5 = a2; | |
1115 v6 = &a2[uEnd]; | |
1116 v7 = &v13; | |
1117 v15 = &a2[uEnd]; | |
1118 v8 = uStart - 1; | |
1119 v16 = uEnd; | |
1120 while ( 1 ) | |
1121 { | |
1122 memcpy(v7, v6, 0x20u); | |
1123 v9 = &v5[v8]; | |
1124 do | |
1125 { | |
1126 ++v9; | |
1127 ++v8; | |
1128 } | |
1129 while ( v9->pos.x < (double)v13.pos.x ); | |
1130 v10 = &v5[v16]; | |
1131 do | |
1132 { | |
1133 --v10; | |
1134 --v16; | |
1135 } | |
1136 while ( v10->pos.x > (double)v13.pos.x ); | |
1137 if ( (signed int)v8 >= (signed int)v16 ) | |
1138 break; | |
1139 v11 = &v5[v16]; | |
1140 memcpy(&v12, &a2[v8], sizeof(v12)); | |
1141 v5 = a2; | |
1142 memcpy(&a2[v8], v11, sizeof(a2[v8])); | |
1143 v6 = &v12; | |
1144 v7 = v11; | |
1145 } | |
1146 memcpy(&v12, &v5[v8], sizeof(v12)); | |
1147 memcpy(&v5[v8], v15, sizeof(v5[v8])); | |
1148 memcpy(v15, &v12, 0x20u); | |
1149 SortVerticesByX(v5, uStart, v8 - 1); | |
1150 SortVerticesByX(a2, v8 + 1, uEnd); | |
1151 } | |
1152 return true; | |
1153 } | |
1154 | |
1155 //----- (004C27AD) -------------------------------------------------------- | |
1156 bool Vis::SortVerticesByY(RenderVertexD3D3 *a2, unsigned int uStart, unsigned int uEnd) | |
1157 { | |
1158 bool result; // eax@1 | |
1159 RenderVertexD3D3 *v5; // edx@2 | |
1160 RenderVertexD3D3 *v6; // esi@2 | |
30 | 1161 void *v7; // edi@2 |
0 | 1162 unsigned int v8; // ebx@2 |
30 | 1163 float *v9; // ecx@3 |
1164 float *v10; // ecx@5 | |
1165 RenderVertexD3D3 *v11; // eax@8 | |
0 | 1166 RenderVertexD3D3 v12; // [sp+4h] [bp-4Ch]@8 |
30 | 1167 RenderVertexD3D3 v13; // [sp+24h] [bp-2Ch]@2 |
0 | 1168 Vis *thisa; // [sp+44h] [bp-Ch]@1 |
30 | 1169 RenderVertexD3D3 *v15; // [sp+48h] [bp-8h]@2 |
1170 unsigned int v16; // [sp+4Ch] [bp-4h]@2 | |
0 | 1171 |
1172 result = uEnd; | |
1173 thisa = this; | |
1174 if ( (signed int)uEnd > (signed int)uStart ) | |
1175 { | |
1176 v5 = a2; | |
1177 v6 = &a2[uEnd]; | |
30 | 1178 v7 = &v13; |
1179 v15 = &a2[uEnd]; | |
0 | 1180 v8 = uStart - 1; |
30 | 1181 v16 = uEnd; |
0 | 1182 while ( 1 ) |
1183 { | |
30 | 1184 memcpy(v7, v6, 0x20u); |
1185 v9 = &v5[v8].pos.y; | |
0 | 1186 do |
1187 { | |
30 | 1188 v9+=8; |
0 | 1189 ++v8; |
1190 } | |
30 | 1191 while ( *v9 < (double)v13.pos.y ); |
1192 v10 = &v5[v16].pos.y; | |
0 | 1193 do |
1194 { | |
30 | 1195 v10-=8; |
1196 --v16; | |
0 | 1197 } |
30 | 1198 while ( *v10 > (double)v13.pos.y ); |
1199 if ( (signed int)v8 >= (signed int)v16 ) | |
0 | 1200 break; |
30 | 1201 v11 = &v5[v16]; |
0 | 1202 memcpy(&v12, &a2[v8], sizeof(v12)); |
1203 v5 = a2; | |
30 | 1204 memcpy(&a2[v8], v11, sizeof(a2[v8])); |
0 | 1205 v6 = &v12; |
30 | 1206 v7 = v11; |
0 | 1207 } |
1208 memcpy(&v12, &v5[v8], sizeof(v12)); | |
30 | 1209 memcpy(&v5[v8], v15, sizeof(v5[v8])); |
1210 memcpy(v15, &v12, 0x20u); | |
194 | 1211 SortVerticesByY(v5, uStart, v8 - 1); |
1212 SortVerticesByY(a2, v8 + 1, uEnd); | |
0 | 1213 } |
1214 return true; | |
1215 } | |
1216 | |
1217 //----- (004C288E) -------------------------------------------------------- | |
196 | 1218 bool Vis::SortByScreenSpaceX(RenderVertexSoft *pArray, int sLeft, int sRight) |
0 | 1219 { |
1220 bool result; // eax@1 | |
1221 RenderVertexSoft *v5; // edx@2 | |
1222 int v6; // ebx@2 | |
1223 int i; // ecx@2 | |
1224 int v8; // esi@3 | |
1225 int v9; // esi@5 | |
159 | 1226 //RenderVertexSoft *v10; // eax@8 |
1227 const void *v10; | |
0 | 1228 RenderVertexSoft v11; // [sp+4h] [bp-6Ch]@8 |
1229 RenderVertexSoft v12; // [sp+34h] [bp-3Ch]@2 | |
159 | 1230 //float v13; // [sp+4Ch] [bp-24h]@4 |
0 | 1231 int v14; // [sp+64h] [bp-Ch]@7 |
159 | 1232 //Vis *thisa; // [sp+68h] [bp-8h]@1 |
196 | 1233 //void *thisa; |
159 | 1234 //RenderVertexSoft *v16; // [sp+6Ch] [bp-4h]@2 |
1235 const void *v16; | |
0 | 1236 |
196 | 1237 //thisa = this; |
159 | 1238 if (sRight <= sLeft) |
1239 return true; | |
1240 v5 = pArray; | |
1241 v16 = &pArray[sRight]; | |
1242 v6 = sLeft - 1; | |
1243 memcpy(&v12, &pArray[sRight], sizeof(v12)); | |
1244 for ( i = sRight; ; i = v14 ) | |
0 | 1245 { |
159 | 1246 v8 = (int)&v5[v6].vWorldViewProjX; |
1247 do | |
0 | 1248 { |
159 | 1249 v8 += 48; |
1250 ++v6; | |
1251 } | |
1252 while ( *(float *)v8 < v12.vWorldViewProjX); | |
1253 v9 = (int)&v5[i].vWorldViewProjX; | |
1254 do | |
1255 { | |
1256 v9 -= 48; | |
1257 --i; | |
0 | 1258 } |
159 | 1259 while ( *(float *)v9 > v12.vWorldViewProjX); |
1260 v14 = i; | |
1261 if ( v6 >= i ) | |
1262 break; | |
1263 v10 = &v5[i]; | |
1264 memcpy(&v11, &pArray[v6], sizeof(v11)); | |
1265 v5 = pArray; | |
1266 memcpy(&pArray[v6], v10, sizeof(pArray[v6])); | |
1267 memcpy((void *)v10, &v11, sizeof(0x30u)); | |
0 | 1268 } |
159 | 1269 memcpy(&v11, &v5[v6], sizeof(v11)); |
1270 memcpy(&v5[v6], v16, sizeof(v5[v6])); | |
1271 memcpy((void *)v16, &v11, sizeof(0x30u)); | |
196 | 1272 SortByScreenSpaceX(v5, sLeft, v6 - 1); |
1273 SortByScreenSpaceX(pArray, v6 + 1, sRight); | |
0 | 1274 return true; |
1275 } | |
1276 | |
1277 //----- (004C297E) -------------------------------------------------------- | |
196 | 1278 bool Vis::SortByScreenSpaceY(RenderVertexSoft *pArray, int sLeft, int sRight) |
0 | 1279 { |
159 | 1280 //bool result; // eax@1 |
0 | 1281 RenderVertexSoft *v5; // edx@2 |
1282 int v6; // ebx@2 | |
1283 int i; // ecx@2 | |
1284 int v8; // esi@3 | |
1285 int v9; // esi@5 | |
159 | 1286 //RenderVertexSoft *v10; // eax@8 |
1287 const void *v10; | |
1288 //char v11; // [sp+4h] [bp-6Ch]@8 | |
1289 RenderVertexSoft v11; | |
0 | 1290 RenderVertexSoft v12; // [sp+34h] [bp-3Ch]@2 |
159 | 1291 //float v13; // [sp+50h] [bp-20h]@4 |
0 | 1292 int v14; // [sp+64h] [bp-Ch]@7 |
159 | 1293 //Vis *thisa; // [sp+68h] [bp-8h]@1 |
0 | 1294 RenderVertexSoft *v16; // [sp+6Ch] [bp-4h]@2 |
1295 | |
159 | 1296 if (sRight <= sLeft) |
1297 return true; | |
1298 v5 = pArray; | |
1299 v16 = &pArray[sRight]; | |
1300 v6 = sLeft - 1; | |
1301 memcpy(&v12, &pArray[sRight], sizeof(v12)); | |
1302 for ( i = sRight; ; i = v14 ) | |
0 | 1303 { |
159 | 1304 v8 = (int)&v5[v6].vWorldViewProjY; |
1305 do | |
1306 { | |
1307 v8 += 48; | |
1308 ++v6; | |
1309 } | |
1310 while ( *(float *)v8 < v12.vWorldViewProjY); | |
1311 v9 = (int)&v5[v6].vWorldViewProjY; | |
1312 do | |
0 | 1313 { |
159 | 1314 v9 -= 48; |
1315 --i; | |
0 | 1316 } |
159 | 1317 while ( *(float *)v9 > v12.vWorldViewProjY); |
1318 v14 = i; | |
1319 if ( v6 >= i ) | |
1320 break; | |
1321 v10 = &v5[i]; | |
1322 memcpy(&v11, &pArray[v6], sizeof(0x30)); | |
1323 v5 = pArray; | |
1324 memcpy(&pArray[v6], v10, sizeof(pArray[v6])); | |
1325 memcpy((void *)v10, &v11, sizeof(0x30)); | |
0 | 1326 } |
159 | 1327 memcpy(&v11, &v5[v6], sizeof(0x30)); |
1328 memcpy(&v5[v6], v16, sizeof(v5[v6])); | |
1329 memcpy((void *)v16, &v11, sizeof(0x30)); | |
196 | 1330 SortByScreenSpaceY(v5, sLeft, v6 - 1); |
1331 SortByScreenSpaceY(pArray, v6 + 1, sRight); | |
0 | 1332 return true; |
1333 } | |
1334 | |
1335 | |
1336 //----- (004C04AF) -------------------------------------------------------- | |
1337 Vis::Vis() | |
1338 { | |
1339 RenderVertexSoft v3; // [sp+Ch] [bp-60h]@1 | |
1340 RenderVertexSoft v4; // [sp+3Ch] [bp-30h]@1 | |
1341 | |
1342 v3.flt_2C = 0.0; | |
1343 v3.vWorldPosition.x = 0.0; | |
1344 v3.vWorldPosition.y = 65536.0; | |
1345 v3.vWorldPosition.z = 0.0; | |
1346 v4.flt_2C = 0.0; | |
1347 v4.vWorldPosition.x = 65536.0; | |
1348 v4.vWorldPosition.y = 0.0; | |
1349 v4.vWorldPosition.z = 0.0; | |
196 | 1350 memcpy(&stru_200C, &v4, sizeof(stru_200C)); |
1351 | |
0 | 1352 v4.flt_2C = 0.0; |
1353 v4.vWorldPosition.x = 0.0; | |
1354 v4.vWorldPosition.y = 65536.0; | |
1355 v4.vWorldPosition.z = 0.0; | |
196 | 1356 memcpy(&stru_203C, &v3, sizeof(stru_203C)); |
1357 | |
0 | 1358 v3.flt_2C = 0.0; |
1359 v3.vWorldPosition.x = 65536.0; | |
1360 v3.vWorldPosition.y = 0.0; | |
1361 v3.vWorldPosition.z = 0.0; | |
196 | 1362 memcpy(&stru_206C, &v3, sizeof(stru_206C)); |
1363 memcpy(&stru_209C, &v4, sizeof(stru_209C)); | |
1364 | |
1365 keyboard_pick_depth = 512; | |
0 | 1366 } |
1367 | |
1368 //----- (004C055C) -------------------------------------------------------- | |
194 | 1369 Vis_SelectionList::Vis_SelectionList() |
0 | 1370 { |
1371 for (uint i = 0; i < 512; ++i) | |
1372 { | |
194 | 1373 object_pool[i].object = nullptr; |
1374 object_pool[i].sZValue = -1; | |
1375 object_pool[i].object_type = VisObjectType_Any; | |
0 | 1376 } |
1377 uNumPointers = 0; | |
1378 } | |
1379 | |
1380 //----- (004C05CC) -------------------------------------------------------- | |
194 | 1381 bool Vis::PickKeyboard(Vis_SelectionList *list, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter) |
0 | 1382 { |
194 | 1383 if (!list) |
1384 list = &default_list; | |
1385 list->uNumPointers = 0; | |
0 | 1386 |
196 | 1387 PickBillboards_Keyboard(keyboard_pick_depth, list, sprite_filter); |
194 | 1388 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
196 | 1389 PickIndoorFaces_Keyboard(keyboard_pick_depth, list, face_filter); |
194 | 1390 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
196 | 1391 PickOutdoorFaces_Keyboard(keyboard_pick_depth, list, face_filter); |
0 | 1392 else |
194 | 1393 assert(false); |
1394 | |
1395 list->create_object_pointers(Vis_SelectionList::Unique); | |
1396 sort_object_pointers(list->object_pointers, 0, list->uNumPointers - 1); | |
1397 | |
0 | 1398 return true; |
1399 } | |
1400 | |
1401 //----- (004C0646) -------------------------------------------------------- | |
194 | 1402 bool Vis::PickMouse(float fDepth, float fMouseX, float fMouseY, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter) |
0 | 1403 { |
1404 RenderVertexSoft pMouseRay[2]; // [sp+1Ch] [bp-60h]@1 | |
1405 | |
194 | 1406 default_list.uNumPointers = 0; |
0 | 1407 CastPickRay(pMouseRay, fMouseX, fMouseY, fDepth); |
194 | 1408 PickBillboards_Mouse(fDepth, fMouseX, fMouseY, &default_list, sprite_filter); |
0 | 1409 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
196 | 1410 PickIndoorFaces_Mouse(fDepth, pMouseRay, &default_list, face_filter); |
227 | 1411 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
1412 PickOutdoorFaces_Mouse(fDepth, pMouseRay, &default_list, face_filter, false); | |
0 | 1413 else |
227 | 1414 { |
323 | 1415 Log::Warning(L"Picking mouse in undefined level"); // picking in main menu is default (buggy) game behaviour. should've returned false in Game::PickMouse |
227 | 1416 return false; |
1417 } | |
194 | 1418 default_list.create_object_pointers(Vis_SelectionList::All); |
1419 sort_object_pointers(default_list.object_pointers, 0, default_list.uNumPointers - 1); | |
1420 | |
0 | 1421 return true; |
1422 } | |
1423 | |
1424 //----- (004C06F8) -------------------------------------------------------- | |
196 | 1425 void Vis::PickBillboards_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter) |
0 | 1426 { |
194 | 1427 for (int i = 0; i < pRenderer->uNumBillboardsToDraw; ++i) |
1428 { | |
1429 auto d3d_billboard = &pRenderer->pBillboardRenderListD3D[i]; | |
0 | 1430 |
194 | 1431 if (is_part_of_selection((void *)i, filter)) |
0 | 1432 { |
194 | 1433 if (DoesRayIntersectBillboard(pick_depth, i)) |
0 | 1434 { |
194 | 1435 auto billboard = &pBillboardRenderList[d3d_billboard->uParentBillboardID]; |
1436 | |
1437 list->AddObject((void *)d3d_billboard->uParentBillboardID, VisObjectType_Sprite, billboard->sZValue); | |
0 | 1438 } |
1439 } | |
1440 } | |
1441 } | |
1442 | |
194 | 1443 |
1444 // tests the object against selection filter to determine whether it can be picked or not | |
0 | 1445 //----- (004C0791) -------------------------------------------------------- |
194 | 1446 bool Vis::is_part_of_selection(void *uD3DBillboardIdx_or_pBLVFace_or_pODMFace, Vis_SelectionFilter *filter) |
0 | 1447 { |
194 | 1448 //stru157 *v3; // esi@1 |
1449 //int result; // eax@1 | |
0 | 1450 int v5; // edx@2 |
194 | 1451 //int v6; // ecx@2 |
1452 //char v7; // zf@3 | |
0 | 1453 int v8; // esi@5 |
1454 std::string *v9; // ecx@7 | |
1455 Actor *v10; // edi@18 | |
194 | 1456 //const char *v12; // [sp-20h] [bp-2Ch]@7 |
0 | 1457 int v13; // [sp-1Ch] [bp-28h]@7 |
194 | 1458 //std::string v14; // [sp-18h] [bp-24h]@7 |
1459 //const char *v15; // [sp-8h] [bp-14h]@7 | |
0 | 1460 int v16; // [sp-4h] [bp-10h]@7 |
1461 | |
194 | 1462 switch (filter->object_type) |
0 | 1463 { |
194 | 1464 case VisObjectType_Any: |
1465 return true; | |
1466 | |
1467 case VisObjectType_Sprite: | |
0 | 1468 { |
194 | 1469 v5 = filter->field_10; |
848 | 1470 int object_idx = PID_ID(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].uParentBillboardID].object_pid); |
1471 int object_type = PID_TYPE(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].uParentBillboardID].object_pid); | |
194 | 1472 if ( v5 & 2 ) |
1473 { | |
1474 if (object_type == filter->object_id) | |
1475 return false; | |
1476 return true; | |
1477 } | |
1478 if ( v5 & 4 ) | |
1479 { | |
1480 v8 = filter->object_id; | |
1481 if ( object_type != filter->object_id) | |
1482 return true; | |
1483 if (v8 != OBJECT_Decoration) | |
1484 { | |
1485 MessageBoxA(nullptr, "Unsupported \"exclusion if no event\" type in CVis::is_part_of_selection", "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Vis.cpp:207", 0); | |
1486 return true; | |
1487 } | |
1488 if (pLevelDecorations[object_idx].uCog || pLevelDecorations[object_idx].field_16_event_id) | |
1489 return true; | |
1490 return pLevelDecorations[object_idx].IsInteractive(); | |
1491 } | |
1492 if (object_type == filter->object_id) | |
1493 { | |
1494 if (object_type != OBJECT_Actor) | |
1495 { | |
1496 MessageBoxA(nullptr, "Default case reached in VIS", "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Vis.cpp:245", 0); | |
1497 return true; | |
1498 } | |
1499 | |
1500 v10 = &pActors[object_idx]; | |
1501 int result = 1 << LOBYTE(v10->uAIState); | |
1502 if ( result & filter->field_C | |
1503 || !(result & filter->field_8) | |
1504 || v5 & 8 && (result = MonsterStats::BelongsToSupertype(v10->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) == 0 ) | |
1505 return false; | |
1506 if ( !(filter->field_10 & 1) ) | |
1507 return true; | |
1508 | |
1509 result = v10->GetActorsRelation(nullptr); | |
1510 if (result == 0) | |
1511 return false; | |
1512 return true; | |
1513 } | |
1514 return false; | |
0 | 1515 } |
194 | 1516 |
1517 case VisObjectType_Face: | |
0 | 1518 { |
194 | 1519 uint face_attrib = 0; |
1520 bool no_event = true; | |
1521 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
1522 { | |
1523 auto face = (ODMFace *)uD3DBillboardIdx_or_pBLVFace_or_pODMFace; | |
1524 no_event = face->sCogTriggeredID == 0; | |
1525 face_attrib = face->uAttributes; | |
1526 } | |
1527 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1528 { | |
1529 auto face = (BLVFace *)uD3DBillboardIdx_or_pBLVFace_or_pODMFace; | |
1530 no_event = pIndoor->pFaceExtras[face->uFaceExtraID].uEventID == 0; | |
1531 face_attrib = face->uAttributes; | |
1532 } | |
1533 else | |
1534 assert(false); | |
1535 | |
1536 if (filter->object_id != OBJECT_BLVDoor) | |
1537 return true; | |
1538 if (no_event || face_attrib & filter->field_C) | |
1539 return false; | |
1540 return (face_attrib & filter->field_8) != 0; | |
0 | 1541 } |
194 | 1542 |
1543 default: | |
1544 assert(false); | |
0 | 1545 } |
1546 } | |
1547 | |
1548 //----- (004C091D) -------------------------------------------------------- | |
1549 bool Vis::DoesRayIntersectBillboard(float fDepth, unsigned int uD3DBillboardIdx) | |
1550 { | |
159 | 1551 int v3; // eax@3 |
1552 //signed int v5; // ecx@4 | |
1553 //float v6; // ST04_4@6 | |
1554 //float v7; // ST00_4@7 | |
194 | 1555 //int v8; // eax@10 |
1556 //unsigned int v9; // eax@12 | |
159 | 1557 int v10; // eax@17 |
1558 double v11; // st6@18 | |
1559 double v12; // st7@18 | |
1560 double v13; // st4@18 | |
1561 float v14; // ST0C_4@22 | |
1562 float v15; // ST08_4@22 | |
1563 //float v16; // ST04_4@23 | |
1564 //float v17; // ST00_4@24 | |
194 | 1565 //signed int v18; // eax@27 |
1566 //unsigned int v19; // eax@29 | |
159 | 1567 double v20; // st6@32 |
1568 double v21; // st7@32 | |
1569 int v22; // eax@32 | |
1570 double v23; // st7@36 | |
1571 //void *v24; // esi@40 | |
1572 float v25; // ST08_4@40 | |
1573 //float v26; // ST04_4@41 | |
1574 //float v27; // ST00_4@42 | |
1575 int v28; // eax@45 | |
1576 unsigned int v29; // eax@47 | |
1577 char result; // al@48 | |
1578 struct RenderVertexSoft pPickingRay[2]; | |
1579 //int v31; // [sp+20h] [bp-DCh]@5 | |
1580 struct RenderVertexSoft local_80[2]; | |
1581 //int v32; // [sp+80h] [bp-7Ch]@22 | |
1582 float v33; // [sp+E0h] [bp-1Ch]@33 | |
1583 float v34; // [sp+E4h] [bp-18h]@32 | |
1584 int v35; // [sp+E8h] [bp-14h]@5 | |
1585 int v36; // [sp+ECh] [bp-10h]@5 | |
194 | 1586 int v37; // [sp+F0h] [bp-Ch]@5 |
159 | 1587 float v38; // [sp+F4h] [bp-8h]@17 |
1588 //void *v39; // [sp+F8h] [bp-4h]@1 | |
1589 signed int v40; // [sp+108h] [bp+Ch]@17 | |
1590 float v41; // [sp+108h] [bp+Ch]@32 | |
0 | 1591 |
194 | 1592 static Vis_SelectionList Vis_static_stru_F91E10; |
0 | 1593 Vis_static_stru_F91E10.uNumPointers = 0; |
159 | 1594 v3 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].uParentBillboardID; |
1595 if (v3 == -1) | |
1596 return false; | |
1597 if (pBillboardRenderList[v3].GetFloatZ() > fDepth) | |
0 | 1598 { |
159 | 1599 LABEL_49: |
1600 return false; | |
1601 } | |
194 | 1602 |
159 | 1603 v37 = pBillboardRenderList[v3].sZValue & 0xFFFF0000; |
1604 GetPolygonCenter(pRenderer->pBillboardRenderListD3D[v3].pQuards, 4, (float *)&v35, (float *)&v36); | |
194 | 1605 CastPickRay(pPickingRay, *(float *)&v35, *(float *)&v36, fDepth); |
1606 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
196 | 1607 PickIndoorFaces_Mouse(fDepth, pPickingRay, &Vis_static_stru_F91E10, &vis_face_filter); |
0 | 1608 else |
196 | 1609 PickOutdoorFaces_Mouse(fDepth, pPickingRay, &Vis_static_stru_F91E10, &vis_face_filter, false); |
194 | 1610 Vis_static_stru_F91E10.create_object_pointers(); |
1611 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1); | |
159 | 1612 if (Vis_static_stru_F91E10.uNumPointers) |
0 | 1613 { |
194 | 1614 if (Vis_static_stru_F91E10.object_pointers[0]->actual_z > pBillboardRenderList[v3].actual_z) |
1615 return 1; | |
159 | 1616 } |
692 | 1617 else if ((double)(pViewport->uScreen_TL_X) <= *(float *)&v35 && |
1618 (double)pViewport->uScreen_BR_X >= *(float *)&v35 && | |
1619 (double)pViewport->uScreen_TL_Y <= *(float *)&v36 && | |
1620 (double)pViewport->uScreen_BR_Y >= *(float *)&v36) | |
159 | 1621 return 1; |
1622 v40 = 0; | |
1623 v10 = (int)&pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.y; | |
1624 LODWORD(v38) = (int)&pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.y; | |
0 | 1625 while ( 1 ) |
1626 { | |
159 | 1627 v12 = *(float *)(v10 - 4); |
1628 v11 = *(float *)v10; | |
1629 v13 = *(float *)(v10 - 4); | |
0 | 1630 Vis_static_stru_F91E10.uNumPointers = 0; |
692 | 1631 if ( v13 >= (double)(pViewport->uScreen_TL_X)) |
0 | 1632 { |
692 | 1633 if ( v12 <= (double)pViewport->uScreen_BR_X ) |
0 | 1634 { |
692 | 1635 if ( v11 >= (double)pViewport->uScreen_TL_Y ) |
159 | 1636 { |
692 | 1637 if ( v11 <= (double)pViewport->uScreen_BR_Y ) |
159 | 1638 { |
1639 v14 = v11; | |
1640 v15 = v12; | |
1641 CastPickRay(local_80, SLODWORD(v15), v14, fDepth); | |
1642 if ( uCurrentlyLoadedLevelType == 1 ) | |
196 | 1643 PickIndoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter); |
159 | 1644 else |
196 | 1645 PickOutdoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter, false); |
194 | 1646 Vis_static_stru_F91E10.create_object_pointers(); |
1647 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1); | |
159 | 1648 if ( !Vis_static_stru_F91E10.uNumPointers ) |
1649 break; | |
194 | 1650 else |
1651 { | |
1652 //v18 = Vis_static_stru_F91E10.uNumPointers <= 0 ? 0 : (int); | |
1653 //v19 = *(_DWORD *)(v18 + 4); | |
1654 //LOWORD(v19) = 0; | |
1655 if (Vis_static_stru_F91E10.object_pointers[0]->actual_z > pBillboardRenderList[v3].actual_z) | |
159 | 1656 break; |
194 | 1657 } |
159 | 1658 } |
1659 } | |
0 | 1660 } |
1661 } | |
159 | 1662 ++v40; |
1663 v10 = LODWORD(v38) + 32; | |
1664 LODWORD(v38) += 32; | |
1665 if ( v40 >= 4 ) | |
0 | 1666 { |
159 | 1667 if ( uCurrentlyLoadedLevelType != 2 ) |
1668 return false; | |
1669 v21 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.x; | |
1670 v20 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[3].pos.x; | |
1671 v22 = *(int *)(&pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[0].pos.y); | |
1672 v34 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[3].pos.x; | |
1673 LODWORD(v38) = v22; | |
1674 v41 = pRenderer->pBillboardRenderListD3D[uD3DBillboardIdx].pQuards[1].pos.y; | |
1675 if ( v21 > v20 ) | |
0 | 1676 { |
159 | 1677 v33 = v21; |
1678 v21 = v34; | |
1679 v20 = v33; | |
0 | 1680 } |
159 | 1681 if ( v38 > (double)v41 ) |
1682 v41 = v38; | |
1683 Vis_static_stru_F91E10.uNumPointers = 0; | |
1684 v23 = (v20 - v21) * 0.5; | |
692 | 1685 if ( v23 < (double)(pViewport->uScreen_TL_X) |
1686 || v23 > (double)pViewport->uScreen_BR_X | |
1687 || (double)pViewport->uScreen_TL_Y > v41 | |
1688 || (double)pViewport->uScreen_BR_Y < v41 | |
159 | 1689 || ((v25 = v23, CastPickRay(local_80, SLODWORD(v25), v41, fDepth), uCurrentlyLoadedLevelType != 1) ? |
196 | 1690 (PickOutdoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter, false)) : |
1691 (PickIndoorFaces_Mouse(fDepth, local_80, &Vis_static_stru_F91E10, &vis_face_filter)), | |
194 | 1692 (Vis_static_stru_F91E10.create_object_pointers(), |
1693 sort_object_pointers(Vis_static_stru_F91E10.object_pointers, 0, Vis_static_stru_F91E10.uNumPointers - 1), | |
159 | 1694 Vis_static_stru_F91E10.uNumPointers) |
194 | 1695 && (Vis_static_stru_F91E10.uNumPointers <= 0 ? (v28 = 0) : (v28 = (int)Vis_static_stru_F91E10.object_pointers), |
159 | 1696 v29 = *(_DWORD *)(v28 + 4), |
1697 LOWORD(v29) = 0, | |
1698 v29 <= v37)) ) | |
1699 return false; | |
0 | 1700 break; |
1701 } | |
1702 } | |
194 | 1703 return true; |
0 | 1704 } |
1705 // F93E18: using guessed type char static_byte_F93E18_init; | |
1706 | |
1707 //----- (004C0D32) -------------------------------------------------------- | |
196 | 1708 void Vis::PickIndoorFaces_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter) |
0 | 1709 { |
1710 int result; // eax@1 | |
742 | 1711 signed int pFaceID; // esi@2 |
1712 BLVFace *pFace; // edi@4 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
742
diff
changeset
|
1713 //unsigned int v7; // eax@6 |
194 | 1714 Vis_ObjectInfo *v8; // eax@6 |
0 | 1715 signed int i; // [sp+18h] [bp-8h]@1 |
1716 | |
1717 result = 0; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
618
diff
changeset
|
1718 for ( i = 0; i < (signed int)pBspRenderer->num_faces; ++i ) |
0 | 1719 { |
742 | 1720 pFaceID = pBspRenderer->faces[result].uFaceID; |
1721 if ( pFaceID >= 0 ) | |
0 | 1722 { |
742 | 1723 if ( pFaceID < (signed int)pIndoor->uNumFaces ) |
0 | 1724 { |
742 | 1725 pFace = &pIndoor->pFaces[pFaceID]; |
1726 if ( !pGame->pIndoorCameraD3D->IsCulled(&pIndoor->pFaces[pFaceID]) ) | |
0 | 1727 { |
742 | 1728 if ( is_part_of_selection(pFace, filter) ) |
0 | 1729 { |
916 | 1730 v8 = DetermineFacetIntersection(pFace, PID(OBJECT_BModel, pFaceID), pick_depth); |
0 | 1731 if ( v8 ) |
194 | 1732 list->AddObject(v8->object, v8->object_type, v8->sZValue); |
0 | 1733 } |
1734 } | |
1735 } | |
1736 } | |
1737 result = i + 1; | |
1738 } | |
1739 } | |
1740 | |
1741 //----- (004C0DEA) -------------------------------------------------------- | |
196 | 1742 void Vis::PickOutdoorFaces_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter) |
0 | 1743 { |
196 | 1744 for (uint i = 0; i < pOutdoor->uNumBModels; ++i) |
1745 { | |
1746 int v17; | |
1747 if (!IsBModelVisible(i, &v17)) | |
1748 continue; | |
1749 if (!v17) | |
1750 continue; | |
0 | 1751 |
196 | 1752 auto bmodel = pOutdoor->pBModels + i; |
1753 for (uint j = 0; j < bmodel->uNumFaces; ++j) | |
0 | 1754 { |
916 | 1755 auto face = &bmodel->pFaces[j]; |
196 | 1756 |
1757 if (is_part_of_selection(face, filter) ) | |
0 | 1758 { |
196 | 1759 BLVFace blv_face; |
1760 blv_face.FromODM(face); | |
1761 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
742
diff
changeset
|
1762 int pid = PID(OBJECT_BModel, j | (i << 6)); |
916 | 1763 if (auto object_info = DetermineFacetIntersection(&blv_face, pid, pick_depth)) |
196 | 1764 list->AddObject(object_info->object, object_info->object_type, object_info->sZValue); |
0 | 1765 } |
1766 } | |
1767 } | |
1768 } |