diff Render.cpp @ 743:353ff9ea11e6

m
author Ritor1
date Fri, 22 Mar 2013 23:42:09 +0600
parents cd9ae9a2c99c
children 852ec78d9548
line wrap: on
line diff
--- a/Render.cpp	Fri Mar 22 23:41:47 2013 +0600
+++ b/Render.cpp	Fri Mar 22 23:42:09 2013 +0600
@@ -8209,17 +8209,17 @@
 //----- (004A354F) --------------------------------------------------------
 void Render::MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle)
 {
-  double v5; // st7@3
-  float v6; // ST20_4@3
-  float v7; // ST00_4@3
+  //double v5; // st7@3
+  //float v6; // ST20_4@3
+  //float v7; // ST00_4@3
   unsigned int v8; // esi@3
-  int v9; // eax@3
-  int v10; // ebx@3
+  //int v9; // eax@3
+  //int v10; // ebx@3
   float v11; // ST28_4@3
-  double v12; // st7@3
-  float v13; // ST24_4@3
-  double v14; // st6@3
-  float v15; // ST1C_4@3
+  //double v12; // st7@3
+  //float v13; // ST24_4@3
+  //double v14; // st6@3
+  //float v15; // ST1C_4@3
   float v16; // ST2C_4@3
   float v17; // ST30_4@3
   signed int v18; // ST18_4@3
@@ -8256,23 +8256,23 @@
   {
     if (a2->zbuffer_depth)
     {
-      v5 = (double)a2->zbuffer_depth;
-      v6 = v5;
-      v7 = v5;
-      v8 = Billboard_ProbablyAddToListAndSortByZOrder(LODWORD(v7));
+      //v5 = (double)a2->zbuffer_depth;
+      //v6 = v5;
+      //v7 = v5;
+      v8 = Billboard_ProbablyAddToListAndSortByZOrder(a2->zbuffer_depth);
       pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Opaque_1;
       pBillboardRenderListD3D[v8].field_90 = a2->field_44;
       pBillboardRenderListD3D[v8].sZValue = a2->sZValue;
       pBillboardRenderListD3D[v8].uParentBillboardID = a2->uParentBillboardID;
-      v9 = a2->uScreenSpaceX;
-      v10 = a2->uScreenSpaceY;
+      //v9 = a2->uScreenSpaceX;
+      //v10 = a2->uScreenSpaceY;
       v11 = (a2->_screenspace_x_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(a2->_screenspace_x_scaler_packedfloat);
-      v12 = (double)v9;
-      v13 = v12;
-      v14 = (double)(v10 - 12);
-      v15 = v14;
-      v16 = (double)(v9 - 12) - v12;
-      v17 = (double)(v10 - 25) - v14;
+      //v12 = (double) a2->uScreenSpaceX;
+      //v13 = v12;
+      //v14 = (double)(a2->uScreenSpaceY - 12);
+      //v15 = v14;
+      v16 = (double)( a2->uScreenSpaceX - 12) - (double) a2->uScreenSpaceX;
+      v17 = (double)(a2->uScreenSpaceY - 25) - (double)(a2->uScreenSpaceY - 12);
       v18 = stru_5C6E00->Cos(angle);
       v19 = stru_5C6E00->Sin(angle);
       v20 = stru_5C6E00->Sin(angle);
@@ -8283,7 +8283,7 @@
                                                        - ((double)(unsigned __int16)v19 * 0.000015259022
                                                        + (double)(v19 >> 16))
                                                        * v17)
-                                                       * v11 + v13;
+                                                       * v11 + (double) a2->uScreenSpaceX;
       v22 = (((double)(unsigned __int16)v21 * 0.000015259022 + (double)(v21 >> 16)) * v17
            + ((double)(unsigned __int16)v20 * 0.000015259022 + (double)(v20 >> 16)) * v16
            - 12.0)
@@ -8292,12 +8292,12 @@
       pBillboardRenderListD3D[v8].pQuards[0].specular = 0;
       pBillboardRenderListD3D[v8].pQuards[0].diffuse = uDiffuse;
       pBillboardRenderListD3D[v8].pQuards[0].pos.y = v22;
-      pBillboardRenderListD3D[v8].pQuards[0].pos.z = 1.0 - 1.0 / (v6 * 0.061758894);
-      pBillboardRenderListD3D[v8].pQuards[0].rhw = 1.0 / v6;
+      pBillboardRenderListD3D[v8].pQuards[0].pos.z = 1.0 - 1.0 / (a2->zbuffer_depth * 0.061758894);
+      pBillboardRenderListD3D[v8].pQuards[0].rhw = 1.0 / a2->zbuffer_depth;
       pBillboardRenderListD3D[v8].pQuards[0].texcoord.x = 0.0;
       pBillboardRenderListD3D[v8].pQuards[0].texcoord.y = 0.0;
-      v31 = (double)(a2->uScreenSpaceX + 12) - v13;
-      v32 = (double)a2->uScreenSpaceY - v15;
+      v31 = (double)(a2->uScreenSpaceX + 12) - (double) a2->uScreenSpaceX;
+      v32 = (double)a2->uScreenSpaceY - (double)(a2->uScreenSpaceY - 12);
       v25 = stru_5C6E00->Cos(angle);
       v26 = stru_5C6E00->Sin(angle);
       v27 = stru_5C6E00->Sin(angle);
@@ -8308,7 +8308,7 @@
                                                        - ((double)(unsigned __int16)v26 * 0.000015259022
                                                        + (double)(v26 >> 16))
                                                        * v32)
-                                                       * v11 + v13;
+                                                       * v11 + (double) a2->uScreenSpaceX;
       v29 = (((double)(unsigned __int16)v28 * 0.000015259022 + (double)(v28 >> 16)) * v32
            + ((double)(unsigned __int16)v27 * 0.000015259022 + (double)(v27 >> 16)) * v31
            - 12.0)
@@ -8322,8 +8322,8 @@
       pBillboardRenderListD3D[v8].pQuards[1].diffuse = uDiffuse;
       pBillboardRenderListD3D[v8].pQuards[1].texcoord.x = 0.0;
       pBillboardRenderListD3D[v8].pQuards[1].texcoord.y = 1.0;
-      v23 = (double)(a2->uScreenSpaceX - 12) - v13;
-      v24 = (double)a2->uScreenSpaceY - v15;
+      v23 = (double)(a2->uScreenSpaceX - 12) - (double) a2->uScreenSpaceX;
+      v24 = (double)a2->uScreenSpaceY - (double)(a2->uScreenSpaceY - 12);
       v33 = stru_5C6E00->Cos(angle);
       v34 = stru_5C6E00->Sin(angle);
       v35 = stru_5C6E00->Sin(angle);
@@ -8334,7 +8334,7 @@
                                                         - ((double)(unsigned __int16)v34 * 0.000015259022
                                                         + (double)(v34 >> 16))
                                                         * v24)
-                                                        * v11 + v13;
+                                                        * v11 + (double) a2->uScreenSpaceX;
       v37 = pBillboardRenderListD3D[v8].pQuards[0].pos.z;
       v38 = (((double)(unsigned __int16)v36 * 0.000015259022 + (double)(v36 >> 16)) * v24
            + ((double)(unsigned __int16)v35 * 0.000015259022 + (double)(v35 >> 16)) * v23
@@ -8348,8 +8348,8 @@
       pBillboardRenderListD3D[v8].pQuards[2].pos.y = v38;
       pBillboardRenderListD3D[v8].pQuards[2].texcoord.x = 1.0;
       pBillboardRenderListD3D[v8].pQuards[2].texcoord.y = 1.0;
-      v39 = (double)(a2->uScreenSpaceX + 12) - v13;
-      v40 = (double)(a2->uScreenSpaceY - 25) - v15;
+      v39 = (double)(a2->uScreenSpaceX + 12) - (double) a2->uScreenSpaceX;
+      v40 = (double)(a2->uScreenSpaceY - 25) - (double)(a2->uScreenSpaceY - 12);
       v41 = stru_5C6E00->Cos(angle);
       v42 = stru_5C6E00->Sin(angle);
       v43 = stru_5C6E00->Sin(angle);
@@ -8360,7 +8360,7 @@
                                                         - ((double)(unsigned __int16)v42 * 0.000015259022
                                                         + (double)(v42 >> 16))
                                                         * v40)
-                                                        * v11 + v13;
+                                                        * v11 + (double) a2->uScreenSpaceX;
       v45 = (((double)(unsigned __int16)v44 * 0.000015259022 + (double)(v44 >> 16)) * v40
            + ((double)(unsigned __int16)v43 * 0.000015259022 + (double)(v43 >> 16)) * v39
            - 12.0)
@@ -8372,7 +8372,7 @@
       pBillboardRenderListD3D[v8].pQuards[3].rhw = pBillboardRenderListD3D[v8].pQuards[0].rhw;
       pBillboardRenderListD3D[v8].pQuards[3].diffuse = uDiffuse;
       pBillboardRenderListD3D[v8].pTexture = a3;
-      pBillboardRenderListD3D[v8].z_order = v6;
+      pBillboardRenderListD3D[v8].z_order = a2->zbuffer_depth;
       pBillboardRenderListD3D[v8].uNumVertices = 4;
       pBillboardRenderListD3D[v8].pQuards[3].pos.y = v45;
       pBillboardRenderListD3D[v8].pQuards[3].texcoord.x = 1.0;