diff Vis.cpp @ 207:f96601c7e503

m
author Ritor1
date Sat, 16 Feb 2013 08:42:43 +0600
parents 1860917d953f
children 8646cad02950
line wrap: on
line diff
--- a/Vis.cpp	Fri Feb 15 22:58:53 2013 +0600
+++ b/Vis.cpp	Sat Feb 16 08:42:43 2013 +0600
@@ -238,12 +238,12 @@
 void Vis::PickBillboards(float fPickDepth, float fX, float fY, Vis_stru1 *a4, stru157 *a2)
 {
   int v6; // ST1C_4@6
-  Vis_stru1_stru0 *v7; // edi@6
-  Vis *thisa; // [sp+20h] [bp-Ch]@1
-  RenderBillboardD3D *v9; // [sp+24h] [bp-8h]@2
-  unsigned int uD3DBillboardIdx; // [sp+28h] [bp-4h]@1
+  //Vis_stru1_stru0 *v7; // edi@6
+  //Vis *thisa; // [sp+20h] [bp-Ch]@1
+  int v9; // [sp+24h] [bp-8h]@2
+  //unsigned int uD3DBillboardIdx; // [sp+28h] [bp-4h]@1
 
-  uD3DBillboardIdx = 0;
+  /*uD3DBillboardIdx = 0;
   thisa = this;
   if ( (signed int)pRenderer->uNumBillboardsToDraw > 0 )
   {
@@ -268,7 +268,22 @@
       ++v9;
     }
     while ( (signed int)uD3DBillboardIdx < (signed int)pRenderer->uNumBillboardsToDraw );
-  }
+  }*/
+   for (unsigned int i = 0; i < pRenderer->uNumBillboardsToDraw; ++i)
+ {
+  v9 = (int)&pRenderer->pBillboardRenderListD3D[i];
+
+  if (is_part_of_selection((BLVFace *)i, a2))
+    if (IsPointInsideD3DBillboard(&pRenderer->pBillboardRenderListD3D[i], fX, fY))
+      if (DoesRayIntersectBillboard(fPickDepth, i))
+      {
+       v6 = pBillboardRenderList[pRenderer->pBillboardRenderListD3D[i].uParentBillboardID].sZValue;
+
+	   a4->array_0004[a4->uNumPointers].pObjectInfo = (void *)pRenderer->pBillboardRenderListD3D[i].uParentBillboardID;
+       a4->array_0004[a4->uNumPointers].sZValue = v6;
+	   a4->array_0004[a4->uNumPointers++].uObjectType = 1;
+      }
+ }
 }
 
 //----- (004C1607) --------------------------------------------------------
@@ -1616,7 +1631,7 @@
 
   stru1.uNumPointers = 0;
   CastPickRay(pMouseRay, fMouseX, fMouseY, fDepth);
-  //PickBillboards(fDepth, fMouseX, fMouseY, &stru1, a5);//Ritor1: do comment to test
+  PickBillboards(fDepth, fMouseX, fMouseY, &stru1, a5);
   if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
     PickIndoor(fDepth, pMouseRay, &stru1, a6);
   else