diff Render.cpp @ 728:9f596a163257

Merge
author Nomad
date Fri, 22 Mar 2013 00:06:50 +0200
parents da130dd3092a 9d13d2ec35a6
children 700b58aac975 14cf77af15de
line wrap: on
line diff
--- a/Render.cpp	Fri Mar 22 00:02:31 2013 +0200
+++ b/Render.cpp	Fri Mar 22 00:06:50 2013 +0200
@@ -7213,7 +7213,7 @@
       }
       ++v7;
     }
-LABEL_23:
+//LABEL_23:
     uNumBillboardsToDraw++;
     return v7;
   }
@@ -7231,7 +7231,9 @@
       }
       while ( v12 );
     }
-    goto LABEL_23;
+    //goto LABEL_23;
+    uNumBillboardsToDraw++;
+    return v7;
   }
   return v7;
 }
@@ -8075,19 +8077,19 @@
 
 
 //----- (004A43B1) --------------------------------------------------------
-void Render::DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *a3, int dimming_level)
-{
-  RenderBillboardTransform_local0 *v4; // ebx@2
-  double v5; // st7@2
-  float v6; // ST08_4@2
+void Render::DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *pSprite, int dimming_level)
+{
+  //RenderBillboardTransform_local0 *v4; // ebx@2
+  //double v5; // st7@2
+  //float v6; // ST08_4@2
   unsigned int v7; // eax@2
-  int v8; // ecx@2
-  unsigned int v9; // esi@2
-  Sprite *v10; // edi@5
+  //int v8; // ecx@2
+  //unsigned int v9; // esi@2
+  //Sprite *v10; // edi@5
   signed int v11; // eax@9
   signed int v12; // eax@9
-  double v13; // st7@12
-  double v14; // st6@12
+  //double v13; // st7@12
+  //double v14; // st6@12
   double v15; // st5@12
   double v16; // st4@12
   double v17; // st3@12
@@ -8096,109 +8098,109 @@
   double v20; // st3@14
   int v21; // ecx@16
   double v22; // st3@16
-  IDirect3DTexture2 *v23; // eax@18
-  signed int v24; // [sp+18h] [bp-18h]@5
-  signed int v25; // [sp+1Ch] [bp-14h]@5
-  Render *v26; // [sp+20h] [bp-10h]@1
+  //IDirect3DTexture2 *v23; // eax@18
+  //signed int v24; // [sp+18h] [bp-18h]@5
+  //signed int v25; // [sp+1Ch] [bp-14h]@5
+  //Render *v26; // [sp+20h] [bp-10h]@1
   float v27; // [sp+24h] [bp-Ch]@5
   int v28; // [sp+28h] [bp-8h]@2
   float v29; // [sp+2Ch] [bp-4h]@5
-  float pSoftBillboarda; // [sp+38h] [bp+8h]@2
+  //float pSoftBillboarda; // [sp+38h] [bp+8h]@2
   float v31; // [sp+3Ch] [bp+Ch]@5
-  float v32; // [sp+3Ch] [bp+Ch]@12
+  //float v32; // [sp+3Ch] [bp+Ch]@12
   float a1; // [sp+40h] [bp+10h]@5
 
-  v26 = this;
+  //v26 = this;
   if ( this->uNumD3DSceneBegins )
   {
-    v4 = pSoftBillboard;
-    v5 = (double)pSoftBillboard->zbuffer_depth;
-    pSoftBillboarda = v5;
-    v6 = v5;
-    v7 = Billboard_ProbablyAddToListAndSortByZOrder(LODWORD(v6));
-    v8 = dimming_level;
-    v9 = v7;
+    //v4 = pSoftBillboard;
+    //v5 = (double)pSoftBillboard->zbuffer_depth;
+    //pSoftBillboarda = pSoftBillboard->zbuffer_depth;
+    //v6 = pSoftBillboard->zbuffer_depth;
+    v7 = Billboard_ProbablyAddToListAndSortByZOrder(pSoftBillboard->zbuffer_depth);
+    //v8 = dimming_level;
+    //v9 = v7;
     v28 = dimming_level & 0xFF000000;
     if ( dimming_level & 0xFF000000 )
-      pBillboardRenderListD3D[v9].uOpacity = RenderBillboardD3D::Opaque_3;
+      pBillboardRenderListD3D[v7].uOpacity = RenderBillboardD3D::Opaque_3;
     else
-      pBillboardRenderListD3D[v9].uOpacity = RenderBillboardD3D::Transparent;
-    v10 = a3;
-    pBillboardRenderListD3D[v9].field_90 = v4->field_44;
-    pBillboardRenderListD3D[v9].sZValue = v4->sZValue;
-    pBillboardRenderListD3D[v9].uParentBillboardID = v4->uParentBillboardID;
-    v25 = v4->uScreenSpaceX;
-    v24 = v4->uScreenSpaceY;
-    a1 = (v4->_screenspace_x_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(v4->_screenspace_x_scaler_packedfloat);
-    v29 = (v4->_screenspace_y_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(v4->_screenspace_y_scaler_packedfloat);
-    v31 = (double)((v10->uBufferWidth >> 1) - v10->uAreaX);
-    v27 = (double)(v10->uBufferHeight - v10->uAreaY);
-    if ( v4->uFlags & 4 )
+      pBillboardRenderListD3D[v7].uOpacity = RenderBillboardD3D::Transparent;
+    //v10 = a3;
+    pBillboardRenderListD3D[v7].field_90 = pSoftBillboard->field_44;
+    pBillboardRenderListD3D[v7].sZValue = pSoftBillboard->sZValue;
+    pBillboardRenderListD3D[v7].uParentBillboardID = pSoftBillboard->uParentBillboardID;
+    //v25 = pSoftBillboard->uScreenSpaceX;
+    //v24 = pSoftBillboard->uScreenSpaceY;
+    a1 = (pSoftBillboard->_screenspace_x_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(pSoftBillboard->_screenspace_x_scaler_packedfloat);
+    v29 = (pSoftBillboard->_screenspace_y_scaler_packedfloat & 0xFFFF) * 0.000015260186 + HIWORD(pSoftBillboard->_screenspace_y_scaler_packedfloat);
+    v31 = (double)((pSprite->uBufferWidth >> 1) - pSprite->uAreaX);
+    v27 = (double)(pSprite->uBufferHeight - pSprite->uAreaY);
+    if ( pSoftBillboard->uFlags & 4 )
       v31 = v31 * -1.0;
-    if ( v4->uTintColor && v26->bTinting )
-    {
-      v11 = ::GetActorTintColor(dimming_level, 0, pSoftBillboarda, 0, 0);
-      v12 = sub_4A19D8(v4->uTintColor, v11);
+    if ( pSoftBillboard->uTintColor && this->bTinting )
+    {
+      v11 = ::GetActorTintColor(dimming_level, 0, pSoftBillboard->zbuffer_depth, 0, 0);
+      v12 = sub_4A19D8(pSoftBillboard->uTintColor, v11);
       if ( v28 )
         v12 = (unsigned int)((char *)&array_77EC08[1852].pEdgeList1[17] + 3) & ((unsigned int)v12 >> 1);
     }
     else
     {
-      v12 = ::GetActorTintColor(dimming_level, 0, pSoftBillboarda, 0, 0);
-    }
-    v13 = (double)v25;
-    pBillboardRenderListD3D[v9].pQuards[0].specular = 0;
-    pBillboardRenderListD3D[v9].pQuards[0].diffuse = v12;
-    pBillboardRenderListD3D[v9].pQuards[0].pos.x = v13 - v31 * a1;
-    v14 = (double)v24;
-    v32 = v14;
-    pBillboardRenderListD3D[v9].pQuards[0].pos.y = v14 - v27 * v29;
-    v15 = 1.0 - 1.0 / (pSoftBillboarda * 0.061758894);
-    pBillboardRenderListD3D[v9].pQuards[0].pos.z = v15;
-    v16 = 1.0 / pSoftBillboarda;
-    pBillboardRenderListD3D[v9].pQuards[0].rhw = 1.0 / pSoftBillboarda;
-    pBillboardRenderListD3D[v9].pQuards[0].texcoord.x = 0.0;
-    pBillboardRenderListD3D[v9].pQuards[0].texcoord.y = 0.0;
-    v17 = (double)((v10->uBufferWidth >> 1) - v10->uAreaX);
-    v18 = (double)(v10->uBufferHeight - v10->uAreaY - v10->uAreaHeight);
-    if ( v4->uFlags & 4 )
+      v12 = ::GetActorTintColor(dimming_level, 0, pSoftBillboard->zbuffer_depth, 0, 0);
+    }
+    //v13 = (double)v25;
+    pBillboardRenderListD3D[v7].pQuards[0].specular = 0;
+    pBillboardRenderListD3D[v7].pQuards[0].diffuse = v12;
+    pBillboardRenderListD3D[v7].pQuards[0].pos.x = pSoftBillboard->uScreenSpaceX - v31 * a1;
+    //v14 = (double)v24;
+    //v32 = v14;
+    pBillboardRenderListD3D[v7].pQuards[0].pos.y = pSoftBillboard->uScreenSpaceY - v27 * v29;
+    v15 = 1.0 - 1.0 / (pSoftBillboard->zbuffer_depth * 0.061758894);
+    pBillboardRenderListD3D[v7].pQuards[0].pos.z = v15;
+    v16 = 1.0 / pSoftBillboard->zbuffer_depth;
+    pBillboardRenderListD3D[v7].pQuards[0].rhw = 1.0 / pSoftBillboard->zbuffer_depth;
+    pBillboardRenderListD3D[v7].pQuards[0].texcoord.x = 0.0;
+    pBillboardRenderListD3D[v7].pQuards[0].texcoord.y = 0.0;
+    v17 = (double)((pSprite->uBufferWidth >> 1) - pSprite->uAreaX);
+    v18 = (double)(pSprite->uBufferHeight - pSprite->uAreaY - pSprite->uAreaHeight);
+    if ( pSoftBillboard->uFlags & 4 )
       v17 = v17 * -1.0;
-    pBillboardRenderListD3D[v9].pQuards[1].specular = 0;
-    pBillboardRenderListD3D[v9].pQuards[1].diffuse = v12;
-    pBillboardRenderListD3D[v9].pQuards[1].pos.x = v13 - v17 * a1;
-    pBillboardRenderListD3D[v9].pQuards[1].pos.y = v32 - v18 * v29;
-    pBillboardRenderListD3D[v9].pQuards[1].pos.z = v15;
-    pBillboardRenderListD3D[v9].pQuards[1].rhw = v16;
-    pBillboardRenderListD3D[v9].pQuards[1].texcoord.x = 0.0;
-    pBillboardRenderListD3D[v9].pQuards[1].texcoord.y = 1.0;
-    v19 = v10->uBufferHeight - v10->uAreaY - v10->uAreaHeight;
-    v20 = (double)(v10->uAreaX + v10->uAreaWidth + (v10->uBufferWidth >> 1) - v10->uBufferWidth);
-    if ( v4->uFlags & 4 )
+    pBillboardRenderListD3D[v7].pQuards[1].specular = 0;
+    pBillboardRenderListD3D[v7].pQuards[1].diffuse = v12;
+    pBillboardRenderListD3D[v7].pQuards[1].pos.x = pSoftBillboard->uScreenSpaceX - v17 * a1;
+    pBillboardRenderListD3D[v7].pQuards[1].pos.y = pSoftBillboard->uScreenSpaceY - v18 * v29;
+    pBillboardRenderListD3D[v7].pQuards[1].pos.z = v15;
+    pBillboardRenderListD3D[v7].pQuards[1].rhw = v16;
+    pBillboardRenderListD3D[v7].pQuards[1].texcoord.x = 0.0;
+    pBillboardRenderListD3D[v7].pQuards[1].texcoord.y = 1.0;
+    v19 = pSprite->uBufferHeight - pSprite->uAreaY - pSprite->uAreaHeight;
+    v20 = (double)(pSprite->uAreaX + pSprite->uAreaWidth + (pSprite->uBufferWidth >> 1) - pSprite->uBufferWidth);
+    if ( pSoftBillboard->uFlags & 4 )
       v20 = v20 * -1.0;
-    pBillboardRenderListD3D[v9].pQuards[2].specular = 0;
-    pBillboardRenderListD3D[v9].pQuards[2].diffuse = v12;
-    pBillboardRenderListD3D[v9].pQuards[2].pos.x = v20 * a1 + v13;
-    pBillboardRenderListD3D[v9].pQuards[2].pos.y = v32 - (double)v19 * v29;
-    pBillboardRenderListD3D[v9].pQuards[2].pos.z = v15;
-    pBillboardRenderListD3D[v9].pQuards[2].rhw = v16;
-    pBillboardRenderListD3D[v9].pQuards[2].texcoord.x = 1.0;
-    pBillboardRenderListD3D[v9].pQuards[2].texcoord.y = 1.0;
-    v21 = v10->uBufferHeight - v10->uAreaY;
-    v22 = (double)(v10->uAreaX + v10->uAreaWidth + (v10->uBufferWidth >> 1) - v10->uBufferWidth);
-    if ( v4->uFlags & 4 )
+    pBillboardRenderListD3D[v7].pQuards[2].specular = 0;
+    pBillboardRenderListD3D[v7].pQuards[2].diffuse = v12;
+    pBillboardRenderListD3D[v7].pQuards[2].pos.x = v20 * a1 + pSoftBillboard->uScreenSpaceX;
+    pBillboardRenderListD3D[v7].pQuards[2].pos.y = pSoftBillboard->uScreenSpaceY - (double)v19 * v29;
+    pBillboardRenderListD3D[v7].pQuards[2].pos.z = v15;
+    pBillboardRenderListD3D[v7].pQuards[2].rhw = v16;
+    pBillboardRenderListD3D[v7].pQuards[2].texcoord.x = 1.0;
+    pBillboardRenderListD3D[v7].pQuards[2].texcoord.y = 1.0;
+    v21 = pSprite->uBufferHeight - pSprite->uAreaY;
+    v22 = (double)(pSprite->uAreaX + pSprite->uAreaWidth + (pSprite->uBufferWidth >> 1) - pSprite->uBufferWidth);
+    if ( pSoftBillboard->uFlags & 4 )
       v22 = v22 * -1.0;
-    pBillboardRenderListD3D[v9].pQuards[3].specular = 0;
-    pBillboardRenderListD3D[v9].pQuards[3].diffuse = v12;
-    pBillboardRenderListD3D[v9].pQuards[3].pos.x = v22 * a1 + v13;
-    pBillboardRenderListD3D[v9].pQuards[3].pos.y = v32 - (double)v21 * v29;
-    pBillboardRenderListD3D[v9].pQuards[3].pos.z = v15;
-    pBillboardRenderListD3D[v9].pQuards[3].rhw = v16;
-    pBillboardRenderListD3D[v9].pQuards[3].texcoord.x = 1.0;
-    pBillboardRenderListD3D[v9].pQuards[3].texcoord.y = 0.0;
-    v23 = v10->pTexture;
-    pBillboardRenderListD3D[v9].uNumVertices = 4;
-    pBillboardRenderListD3D[v9].z_order = pSoftBillboarda;
-    pBillboardRenderListD3D[v9].pTexture = v23;
+    pBillboardRenderListD3D[v7].pQuards[3].specular = 0;
+    pBillboardRenderListD3D[v7].pQuards[3].diffuse = v12;
+    pBillboardRenderListD3D[v7].pQuards[3].pos.x = v22 * a1 + pSoftBillboard->uScreenSpaceX;
+    pBillboardRenderListD3D[v7].pQuards[3].pos.y = pSoftBillboard->uScreenSpaceY - (double)v21 * v29;
+    pBillboardRenderListD3D[v7].pQuards[3].pos.z = v15;
+    pBillboardRenderListD3D[v7].pQuards[3].rhw = v16;
+    pBillboardRenderListD3D[v7].pQuards[3].texcoord.x = 1.0;
+    pBillboardRenderListD3D[v7].pQuards[3].texcoord.y = 0.0;
+    //v23 = pSprite->pTexture;
+    pBillboardRenderListD3D[v7].uNumVertices = 4;
+    pBillboardRenderListD3D[v7].z_order = pSoftBillboard->zbuffer_depth;
+    pBillboardRenderListD3D[v7].pTexture = pSprite->pTexture;
   }
 }