# HG changeset patch # User Ritor1 # Date 1370583071 -21600 # Node ID 9541e9d1e5fadd5f524100c0a537d83a993b91ae # Parent 02e2a5c1ebc07757076eeceff2ba837f1198e39c m diff -r 02e2a5c1ebc0 -r 9541e9d1e5fa stru9.cpp --- a/stru9.cpp Fri Jun 07 11:30:29 2013 +0600 +++ b/stru9.cpp Fri Jun 07 11:31:11 2013 +0600 @@ -6,7 +6,7 @@ //----- (00498377) -------------------------------------------------------- -bool stru9::_498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *a3, struct RenderVertexSoft *pVertices, unsigned int *pOutNumVertices) +bool stru9::_498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *pVertices, struct RenderVertexSoft *pVertices2, unsigned int *pOutNumVertices) { int result; // eax@7 //unsigned int *v7; // ebx@7 @@ -19,7 +19,7 @@ //VertexBuffer *v14; // edx@26 //char *v15; // eax@26 //unsigned int i; // ecx@26 - int v17; // [sp+0h] [bp-28h]@9 + //int v17; // [sp+0h] [bp-28h]@9 //char *v18; // [sp+10h] [bp-18h]@8 RenderVertexSoft *v19; // [sp+14h] [bp-14h]@0 //RenderVertexSoft *v20; // [sp+18h] [bp-10h]@0 @@ -59,7 +59,7 @@ //VertexBuffer::VertexBuffer(&static_AE33A0); }*/ - result = 0; + result = false; //v7 = pOutNumVertices; v21 = 0; if ( (signed int)uNumVertices <= 0 ) @@ -71,11 +71,11 @@ //v8 = (char *)&a3->y; //v18 = (char *)&a3->y; //do - for (v17 = 0; v17 < uNumVertices; v17++ ) + for (uint j = 0; j < uNumVertices; j++ ) { //v17 = result + 1; - result = v17; - v9 = &pPortalBounding[(result + 1) % (signed int)uNumVertices]; + result = j; + v9 = &pPortalBounding[(j + 1) % (signed int)uNumVertices]; if ( pPortalBounding->vWorldPosition.x != v9->vWorldPosition.x || pPortalBounding->vWorldPosition.y != v9->vWorldPosition.y || pPortalBounding->vWorldPosition.z != v9->vWorldPosition.z ) @@ -86,9 +86,9 @@ //result = 0; static_AE33A0.uNumVertices = 0; //a3a = 0; - static_AE3FA4.x = a3->x; - static_AE3FA4.y = a3->y; - static_AE3FA4.z = a3->z; + static_AE3FA4.x = pVertices->x; + static_AE3FA4.y = pVertices->y; + static_AE3FA4.z = pVertices->z; if ( (signed int)*pOutNumVertices <= 0 ) { *pOutNumVertices = 0; @@ -100,17 +100,17 @@ //v12 = &pVertices[result]; if ( result ) { - if ( _4989E1(&pVertices[i], &pVertices[i], pPortalBounding, &static_AE3FA4) - && _498774(&pVertices[i], &pVertices[i], pPortalBounding, &static_AE3FA4, &static_AE3FB4) ) + if ( _4989E1(&pVertices2[i], &pVertices2[i], pPortalBounding, &static_AE3FA4) + && _498774(&pVertices2[i], &pVertices2[i], pPortalBounding, &static_AE3FA4, &static_AE3FB4) ) AddVertex(&static_AE33A0, &static_AE3FB4); } else { - v19 = &pVertices[i]; + v19 = &pVertices2[i]; } //v20 = v12; - if ( AreVectorsCollinear(&pVertices[i], pPortalBounding, &static_AE3FA4) )// - AddVertex(&static_AE33A0, &pVertices[i]); + if ( AreVectorsCollinear(&pVertices2[i], pPortalBounding, &static_AE3FA4) )// + AddVertex(&static_AE33A0, &pVertices2[i]); //pOutNumVertices = pOutNumVertices; //a3a++; } @@ -120,17 +120,17 @@ *pOutNumVertices = 0; return true; } - if ( _4989E1(&pVertices[result], v19, pPortalBounding, &static_AE3FA4) - && _498774(&pVertices[result], v19, pPortalBounding, &static_AE3FA4, &static_AE3FB4) ) + if ( _4989E1(&pVertices2[result], v19, pPortalBounding, &static_AE3FA4) + && _498774(&pVertices2[result], v19, pPortalBounding, &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; + pVertices2[i].vWorldPosition.x = static_AE33A0.pVertices[i].vWorldPosition.x; + pVertices2[i].vWorldPosition.y = static_AE33A0.pVertices[i].vWorldPosition.y; + pVertices2[i].vWorldPosition.z = static_AE33A0.pVertices[i].vWorldPosition.z; + pVertices2[i].u = static_AE33A0.pVertices[i].u; + pVertices2[i].v = static_AE33A0.pVertices[i].v; } //v13 = static_AE33A0.uNumVertices; @@ -163,7 +163,7 @@ } //result = v17; ++pPortalBounding; - a3++; + pVertices++; //v18 = (char *)&a3->y; } //while ( v17 < (signed int)uNumVertices ); diff -r 02e2a5c1ebc0 -r 9541e9d1e5fa stru9.h --- a/stru9.h Fri Jun 07 11:30:29 2013 +0600 +++ b/stru9.h Fri Jun 07 11:31:11 2013 +0600 @@ -51,7 +51,7 @@ {} bool _4980B9(struct RenderVertexSoft *a1, unsigned int uNumVertices, float a3, float a4, float a5, struct RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices); - bool _498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *a3, struct RenderVertexSoft *pVertices, unsigned int *pOutNumVertices); + bool _498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *pVertices, struct RenderVertexSoft *pVertices2, unsigned int *pOutNumVertices); bool CalcPortalShape(struct RenderVertexSoft *a1, signed int a2, struct RenderVertexSoft *a3, unsigned int *pOutNumVertices, struct Vec3_float_ *a5, float a6, char *a7, int unused); void AddVertex(struct VertexBuffer *pVertexBuffer, struct RenderVertexSoft *pVertex); bool _498774(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4, struct RenderVertexSoft *a5);