changeset 691:c93f29773f84

Bsp render seems to work
author Nomad
date Sat, 16 Mar 2013 14:33:23 +0200
parents 26dfde53decd
children 066e2b29b30f 964323fa0d25
files stru9.cpp
diffstat 1 files changed, 23 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/stru9.cpp	Sat Mar 16 01:25:15 2013 +0400
+++ b/stru9.cpp	Sat Mar 16 14:33:23 2013 +0200
@@ -16,9 +16,9 @@
   //double v11; // st6@12
   //RenderVertexSoft *v12; // esi@13
   //int v13; // ecx@25
-  VertexBuffer *v14; // edx@26
-  char *v15; // eax@26
-  unsigned int i; // ecx@26
+  //VertexBuffer *v14; // edx@26
+  //char *v15; // eax@26
+  //unsigned int i; // ecx@26
   int v17; // [sp+0h] [bp-28h]@9
   //char *v18; // [sp+10h] [bp-18h]@8
   RenderVertexSoft *v19; // [sp+14h] [bp-14h]@0
@@ -27,38 +27,38 @@
   //RenderVertexSoft *a2; // [sp+20h] [bp-8h]@8
   //stru9 *thisa; // [sp+24h] [bp-4h]@1
   signed int a3a; // [sp+38h] [bp+10h]@12
-  int a3b; // [sp+38h] [bp+10h]@25
+  //int a3b; // [sp+38h] [bp+10h]@25
 
   //__debugbreak();
 
   //thisa = this;
 
   static RenderVertexSoft static_AE3FB4;
-  static bool __init_flag1 = false;
+  /*static bool __init_flag1 = false;
   if (!__init_flag1)
   {
     __init_flag1 = true;
 
     static_AE3FB4.flt_2C = 0.0;
-  }
+  }*/
 
   static stru312 static_AE3FA4; // idb
-  static bool __init_flag2 = false;
+  /*static bool __init_flag2 = false;
   if (!__init_flag2)
   {
     __init_flag2 = true;
 
     //stru312::stru312(&static_AE3FA4);
-  }
+  }*/
 
   static VertexBuffer static_AE33A0; // idb
-  static bool __init_flag3 = false;
+  /*static bool __init_flag3 = false;
   if (!__init_flag3)
   {
     __init_flag3 = true;
 
     //VertexBuffer::VertexBuffer(&static_AE33A0);
-  }
+  }*/
 
   result = 0;
   //v7 = pOutNumVertices;
@@ -124,8 +124,18 @@
       if ( _4989E1(&pVertices[result], v19, a1, &static_AE3FA4)
         && _498774(&pVertices[result], v19, a1, &static_AE3FA4, &static_AE3FB4) )
         AddVertex(&static_AE33A0, &static_AE3FB4);
+
+      for (uint i = 0; i < static_AE33A0.uNumVertices; ++i)
+      {
+        pVertices[i].vWorldPosition.x = static_AE33A0.pVertices[i].vWorldPosition.x;
+        pVertices[i].vWorldPosition.y = static_AE33A0.pVertices[i].vWorldPosition.y;
+        pVertices[i].vWorldPosition.z = static_AE33A0.pVertices[i].vWorldPosition.z;
+        pVertices[i].u = static_AE33A0.pVertices[i].u;
+        pVertices[i].v = static_AE33A0.pVertices[i].v;
+      }
+
       //v13 = static_AE33A0.uNumVertices;
-      a3b = 0;
+      /*a3b = 0;
       if ( static_AE33A0.uNumVertices > 0 )
       {
         v14 = &static_AE33A0;
@@ -146,7 +156,8 @@
           if ( a3b >= static_AE33A0.uNumVertices )
             break;
         }
-      }
+      }*/
+
       //v7 = pOutNumVertices;
       //a3->y = a3->y;
       *pOutNumVertices = static_AE33A0.uNumVertices;
@@ -162,7 +173,6 @@
   return true;
 }
 
-// AE3FE4: using guessed type char static_init_flag__AE3FB4_bit1__AE3FA4_bit2__AE33A0_bit3;
 
 //----- (004985FB) --------------------------------------------------------
 bool stru9::_4985FB(struct RenderVertexSoft *a1, signed int a2, struct RenderVertexSoft *a3, unsigned int *pOutNumVertices, struct Vec3_float_ *a5, float a6, char *a7, int unused)