comparison Vis.cpp @ 207:f96601c7e503

m
author Ritor1
date Sat, 16 Feb 2013 08:42:43 +0600
parents 1860917d953f
children 8646cad02950
comparison
equal deleted inserted replaced
206:f9cfc1867efd 207:f96601c7e503
236 236
237 //----- (004C1542) -------------------------------------------------------- 237 //----- (004C1542) --------------------------------------------------------
238 void Vis::PickBillboards(float fPickDepth, float fX, float fY, Vis_stru1 *a4, stru157 *a2) 238 void Vis::PickBillboards(float fPickDepth, float fX, float fY, Vis_stru1 *a4, stru157 *a2)
239 { 239 {
240 int v6; // ST1C_4@6 240 int v6; // ST1C_4@6
241 Vis_stru1_stru0 *v7; // edi@6 241 //Vis_stru1_stru0 *v7; // edi@6
242 Vis *thisa; // [sp+20h] [bp-Ch]@1 242 //Vis *thisa; // [sp+20h] [bp-Ch]@1
243 RenderBillboardD3D *v9; // [sp+24h] [bp-8h]@2 243 int v9; // [sp+24h] [bp-8h]@2
244 unsigned int uD3DBillboardIdx; // [sp+28h] [bp-4h]@1 244 //unsigned int uD3DBillboardIdx; // [sp+28h] [bp-4h]@1
245 245
246 uD3DBillboardIdx = 0; 246 /*uD3DBillboardIdx = 0;
247 thisa = this; 247 thisa = this;
248 if ( (signed int)pRenderer->uNumBillboardsToDraw > 0 ) 248 if ( (signed int)pRenderer->uNumBillboardsToDraw > 0 )
249 { 249 {
250 v9 = pRenderer->pBillboardRenderListD3D;//[0].uParentBillboardID; 250 v9 = pRenderer->pBillboardRenderListD3D;//[0].uParentBillboardID;
251 do 251 do
266 } 266 }
267 ++uD3DBillboardIdx; 267 ++uD3DBillboardIdx;
268 ++v9; 268 ++v9;
269 } 269 }
270 while ( (signed int)uD3DBillboardIdx < (signed int)pRenderer->uNumBillboardsToDraw ); 270 while ( (signed int)uD3DBillboardIdx < (signed int)pRenderer->uNumBillboardsToDraw );
271 } 271 }*/
272 for (unsigned int i = 0; i < pRenderer->uNumBillboardsToDraw; ++i)
273 {
274 v9 = (int)&pRenderer->pBillboardRenderListD3D[i];
275
276 if (is_part_of_selection((BLVFace *)i, a2))
277 if (IsPointInsideD3DBillboard(&pRenderer->pBillboardRenderListD3D[i], fX, fY))
278 if (DoesRayIntersectBillboard(fPickDepth, i))
279 {
280 v6 = pBillboardRenderList[pRenderer->pBillboardRenderListD3D[i].uParentBillboardID].sZValue;
281
282 a4->array_0004[a4->uNumPointers].pObjectInfo = (void *)pRenderer->pBillboardRenderListD3D[i].uParentBillboardID;
283 a4->array_0004[a4->uNumPointers].sZValue = v6;
284 a4->array_0004[a4->uNumPointers++].uObjectType = 1;
285 }
286 }
272 } 287 }
273 288
274 //----- (004C1607) -------------------------------------------------------- 289 //----- (004C1607) --------------------------------------------------------
275 bool Vis::IsPointInsideD3DBillboard(RenderBillboardD3D *a1, float x, float y) 290 bool Vis::IsPointInsideD3DBillboard(RenderBillboardD3D *a1, float x, float y)
276 { 291 {
1614 { 1629 {
1615 RenderVertexSoft pMouseRay[2]; // [sp+1Ch] [bp-60h]@1 1630 RenderVertexSoft pMouseRay[2]; // [sp+1Ch] [bp-60h]@1
1616 1631
1617 stru1.uNumPointers = 0; 1632 stru1.uNumPointers = 0;
1618 CastPickRay(pMouseRay, fMouseX, fMouseY, fDepth); 1633 CastPickRay(pMouseRay, fMouseX, fMouseY, fDepth);
1619 //PickBillboards(fDepth, fMouseX, fMouseY, &stru1, a5);//Ritor1: do comment to test 1634 PickBillboards(fDepth, fMouseX, fMouseY, &stru1, a5);
1620 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) 1635 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
1621 PickIndoor(fDepth, pMouseRay, &stru1, a6); 1636 PickIndoor(fDepth, pMouseRay, &stru1, a6);
1622 else 1637 else
1623 PickOutdoor(fDepth, pMouseRay, &stru1, a6, 0); 1638 PickOutdoor(fDepth, pMouseRay, &stru1, a6, 0);
1624 stru1.create_object_pointers(0); 1639 stru1.create_object_pointers(0);