# HG changeset patch # User Ritor1 # Date 1358925281 -21600 # Node ID f6e7d7110512a72464cd908c88558d4195a58914 # Parent a96ebf3123d2bd0e9f9f830c11c6b74c99777757# Parent 80484cf3a68336549a0bc7a48cd98a5d7498062c Слияние diff -r 80484cf3a683 -r f6e7d7110512 LightmapBuilder.cpp --- a/LightmapBuilder.cpp Wed Jan 23 00:50:28 2013 +0600 +++ b/LightmapBuilder.cpp Wed Jan 23 13:14:41 2013 +0600 @@ -1183,7 +1183,7 @@ v19 = v16 < v17; v20 = 0; v21 = v16 == v17; - BYTE1(result) = HIBYTE(v18); +// BYTE1(result) = HIBYTE(v18); if ( v16 <= v17 || (v22 = *(float *)&X + *(float *)&uStripType, //UNDEF(v23), diff -r 80484cf3a683 -r f6e7d7110512 ParticleEngine.cpp --- a/ParticleEngine.cpp Wed Jan 23 00:50:28 2013 +0600 +++ b/ParticleEngine.cpp Wed Jan 23 13:14:41 2013 +0600 @@ -93,10 +93,10 @@ uTimeElapsed += pEventTimer->uTimeElapsed; pLines.uNumLines = 0; - if (uCurrentlyLoadedLevelType == LEVEL_Indoor) - DrawParticles_BLV(); - else - DrawParticles_ODM(); + //if (uCurrentlyLoadedLevelType == LEVEL_Indoor) + //DrawParticles_BLV(); + //else + //DrawParticles_ODM(); if (pRenderer->pRenderD3D) { diff -r 80484cf3a683 -r f6e7d7110512 Render.cpp diff -r 80484cf3a683 -r f6e7d7110512 Vis.cpp diff -r 80484cf3a683 -r f6e7d7110512 mm7_3.cpp --- a/mm7_3.cpp Wed Jan 23 00:50:28 2013 +0600 +++ b/mm7_3.cpp Wed Jan 23 13:14:41 2013 +0600 @@ -9360,166 +9360,36 @@ } //----- (00481FC9) -------------------------------------------------------- -int __fastcall sub_481FC9(RenderVertexSoft *_ECX, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4) -{ - __debugbreak(); - return 0; - /*signed int result; // eax@5 - __int64 v11; // ST08_8@6 - __int64 v12; // ST08_8@6 - __int64 v13; // ST08_8@6 - __int64 v14; // ST08_8@6 - - __asm { fld dword ptr [ecx+8] } - _ESI = a2; - _EDX = a3; - __asm { fcomp dword ptr [esi+8] } - _EDI = a4; - __asm { fnstsw ax } - if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) ) - { - __asm - { - fld dword ptr [esi+8] - fcomp dword ptr [edx+8] - fnstsw ax - } - if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) ) - *(int *)&a4->flags |= 0x10u; - } - __asm - { - fld dword ptr [ecx+0Ch] - fsub dword ptr [esi+0Ch] - fstp [ebp+var_C] - fld dword ptr [ecx+10h] - fsub dword ptr [esi+10h] - fstp [ebp+var_14] - fld dword ptr [ecx+14h] - fsub dword ptr [esi+14h] - fstp [ebp+arg_0] - fld dword ptr [edx+0Ch] - fsub dword ptr [esi+0Ch] - fstp [ebp+var_10] - fld dword ptr [edx+10h] - fsub dword ptr [esi+10h] - fstp [ebp+var_8] - fld dword ptr [edx+14h] - fsub dword ptr [esi+14h] - fstp [ebp+var_4] - fld dword ptr [ecx] - fsub dword ptr [esi] - fld dword ptr [ecx+4] - fsub dword ptr [esi+4] - fld dword ptr [ecx+8] - fsub dword ptr [esi+8] - fld dword ptr [edx] - fsub dword ptr [esi] - fld dword ptr [edx+4] - fsub dword ptr [esi+4] - fld dword ptr [edx+8] - fsub dword ptr [esi+8] - fstp [ebp+arg_4] - fld st - fmul st, st(3) - fld [ebp+arg_4] - fmul st, st(5) - fsubp st(1), st - fild pIndoorCamera->pos.x - fsub dword ptr [esi] - fmulp st(1), st - fld [ebp+arg_4] - fmul st, st(6) - fld st(3) - fmul st, st(5) - fsubp st(1), st - fild pIndoorCamera->pos.y - fsub dword ptr [esi+4] - fmulp st(1), st - faddp st(1), st - fld st(2) - fmul st, st(5) - fld st(2) - fmul st, st(7) - fsubp st(1), st - fild pIndoorCamera->pos.z - fsub dword ptr [esi+8] - fmulp st(1), st - faddp st(1), st - fcomp ds:flt_4D84E8 - fstp st - fstp st - fstp st - fnstsw ax - fstp st - fstp st - } - if ( __SETP__(HIBYTE(_AX) & 0x41, 0) ) - { - __asm - { - fld [ebp+var_4] - fmul [ebp+var_14] - fld [ebp+var_8] - fmul [ebp+arg_0] - fsubp st(1), st - fstp [ebp+arg_4] - fld [ebp+arg_4] - fadd ds:flt_4D87D0 - fstp [ebp+var_20] - fld [ebp+var_10] - fmul [ebp+arg_0] - fld [ebp+var_4] - fmul [ebp+var_C] - } - _EDI->v_18.x = v11; - __asm - { - fsubp st(1), st - fstp [ebp+arg_4] - fld [ebp+arg_4] - fadd ds:flt_4D87D0 - fstp [ebp+var_20] - fld [ebp+var_8] - fmul [ebp+var_C] - fld [ebp+var_10] - fmul [ebp+var_14] - } - _EDI->v_18.y = v12; - __asm - { - fsubp st(1), st - fstp [ebp+arg_4] - fld [ebp+arg_4] - fadd ds:flt_4D87D0 - fstp [ebp+var_20] - } - _EDI->v_18.z = v13; - stru148::_486089_normalize_v_18(_EDI); - __asm - { - fild dword ptr [edi+18h] - fmul dword ptr [esi+0Ch] - fchs - fild dword ptr [edi+1Ch] - fmul dword ptr [esi+10h] - fsubp st(1), st - fild dword ptr [edi+20h] - fmul dword ptr [esi+14h] - fsubp st(1), st - fstp [ebp+arg_4] - fld [ebp+arg_4] - fadd ds:flt_4D87D0 - fstp [ebp+var_20] - } - _EDI->field_24 = v14; - result = 1; - } - else - { - result = 0; - } - return result;*/ +int __fastcall sub_481FC9(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4) +{ + float arg_0, arg_4, var_4, var_8, var_c, var_10, var_14; + + if (a1->vWorldPosition.y == a2->vWorldPosition.y && a2->vWorldPosition.y == a3->vWorldPosition.y) + a4->flags |= 0x10; + var_c = a1->vWorldViewPosition.x - a2->vWorldViewPosition.x; + var_14 = a1->vWorldViewPosition.y - a2->vWorldViewPosition.y; + arg_0 = a1->vWorldViewPosition.z - a2->vWorldViewPosition.z; + var_10 = a3->vWorldViewPosition.x - a2->vWorldViewPosition.x; + var_8 = a3->vWorldViewPosition.y - a2->vWorldViewPosition.y; + var_4 = a3->vWorldViewPosition.z - a2->vWorldViewPosition.z; + arg_4 = a3->vWorldPosition.y - a2->vWorldPosition.y; + if (((a3->vWorldPosition.y - a2->vWorldPosition.y) * (a1->vWorldPosition.x - a2->vWorldPosition.x) - (a3->vWorldPosition.x - a2->vWorldPosition.x) * (a1->vWorldPosition.y - a2->vWorldPosition.y)) * (pIndoorCamera->pos.y - a2->vWorldPosition.z) + + ((a3->vWorldPosition.z - a2->vWorldPosition.z) * (a1->vWorldPosition.y - a2->vWorldPosition.y) - (a3->vWorldPosition.y - a2->vWorldPosition.y) * (a1->vWorldPosition.z - a2->vWorldPosition.z)) * (pIndoorCamera->pos.x - a2->vWorldPosition.x) + + ((a3->vWorldPosition.x - a2->vWorldPosition.x) * (a1->vWorldPosition.z - a2->vWorldPosition.z) - (a3->vWorldPosition.z - a2->vWorldPosition.z) * (a1->vWorldPosition.x - a2->vWorldPosition.x)) * (pIndoorCamera->pos.z - a2->vWorldPosition.y) < 0) + { + arg_4 = var_4 * var_14 - var_8 * arg_0; + a4->v_18.x = floorf(arg_4 + 0.5f); + arg_4 = var_10 * arg_0 - var_4 * var_c; + a4->v_18.y = floorf(arg_4 + 0.5f); + arg_4 = var_8 * var_c - var_10 * var_14; + a4->v_18.z = floorf(arg_4 + 0.5f); + a4->_486089_normalize_v_18(); + arg_4 = -(a4->v_18.x * a2->vWorldViewPosition.x) - a4->v_18.y * a2->vWorldViewPosition.y - a4->v_18.z * a2->vWorldViewPosition.z; + a4->field_24 = floorf(arg_4 + 0.5f); + return true; + } + else + return false; }