Mercurial > mm7
diff mm7_3.cpp @ 1399:91ff22cc755b
Слияние
author | Ritor1 |
---|---|
date | Thu, 18 Jul 2013 09:40:14 +0600 |
parents | 8557d021a31b 613c77e51e38 |
children | 3161094869e0 |
line wrap: on
line diff
--- a/mm7_3.cpp Thu Jul 18 09:40:05 2013 +0600 +++ b/mm7_3.cpp Thu Jul 18 09:40:14 2013 +0600 @@ -3830,7 +3830,6 @@ return result; } -// 47730C: using guessed type int __stdcall const_1(int); //----- (004775ED) -------------------------------------------------------- int stru6_stru1_indoor_sw_billboard::_4775ED(float a2) @@ -3875,20 +3874,20 @@ float v39; // [sp+D0h] [bp-8h]@6 int *v40; // [sp+D4h] [bp-4h]@2 - v2 = (char *)&this->field_14[4 * this->field_10 + 20]; + v2 = (char *)&this->field_64[4 * this->uNumVertices]; v38 = 0; - *(int *)v2 = this->field_14[20]; + *(int *)v2 = this->field_64[0]; v2 += 4; - *(int *)v2 = this->field_14[21]; + *(int *)v2 = this->field_64[1]; v2 += 4; - *(int *)v2 = this->field_14[22]; - *((int *)v2 + 1) = this->field_14[23]; - v3 = this->field_10; + *(int *)v2 = this->field_64[2]; + *((int *)v2 + 1) = this->field_64[3]; + v3 = this->uNumVertices; v35 = this; if ( v3 > 0 ) { - v40 = &this->field_14[40]; - v4 = (char *)&this->field_14[23] + 3; + v40 = &this->field_64[20]; + v4 = (char *)&this->field_64[3] + 3; v34 = v3; while ( 1 ) { @@ -3974,9 +3973,7 @@ goto LABEL_10; } LABEL_12: - result = v38; - this->field_10 = v38; - return result; + return this->uNumVertices = v38; } //----- (00477927) -------------------------------------------------------- @@ -4022,20 +4019,20 @@ float v39; // [sp+D0h] [bp-8h]@6 int *v40; // [sp+D4h] [bp-4h]@2 - v2 = (char *)&this->field_14[4 * this->field_10 + 20]; + v2 = (char *)&this->field_64[4 * this->uNumVertices]; v38 = 0; - *(int *)v2 = this->field_14[20]; + *(int *)v2 = this->field_64[0]; v2 += 4; - *(int *)v2 = this->field_14[21]; + *(int *)v2 = this->field_64[1]; v2 += 4; - *(int *)v2 = this->field_14[22]; - *((int *)v2 + 1) = this->field_14[23]; - v3 = this->field_10; + *(int *)v2 = this->field_64[2]; + *((int *)v2 + 1) = this->field_64[3]; + v3 = this->uNumVertices; v35 = this; if ( v3 > 0 ) { - v40 = &this->field_14[40]; - v4 = (char *)&this->field_14[23] + 3; + v40 = &this->field_64[20]; + v4 = (char *)&this->field_64[3] + 3; v34 = v3; while ( 1 ) { @@ -4121,9 +4118,7 @@ goto LABEL_10; } LABEL_12: - result = v38; - this->field_10 = v38; - return result; + return this->uNumVertices = v38; } //----- (00477C61) -------------------------------------------------------- @@ -4175,7 +4170,7 @@ if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) { v2 = 0; - if ( this->field_10 > 0 ) + if ( this->uNumVertices > 0 ) { v3 = (int)&this->field_14[1]; do @@ -4228,7 +4223,7 @@ *(float *)(v3 + 80) = v11; v3 += 16; } - while ( v2 < this->field_10 ); + while ( v2 < this->uNumVertices ); } } else @@ -4274,7 +4269,7 @@ } while ( v31 ); } - this->field_10 = 3; + this->uNumVertices = 3; return 1; } @@ -4306,7 +4301,7 @@ v10 = (double)pOutdoorCamera->shading_dist_mist; v3 = 8.0; } - v4 = a1->field_10; + v4 = a1->uNumVertices; if ( v4 <= 0 ) goto LABEL_16; v5 = (char *)&a1->field_14[20]; @@ -4329,15 +4324,15 @@ if ( v9 ) { v2->_477927(v10); - return v2->field_10 != 0; + return v2->uNumVertices != 0; } LABEL_16: memcpy(&v2->field_14[40], &v2->field_14[20], 16 * v4); - return v2->field_10 != 0; + return v2->uNumVertices != 0; } v7 = v3; _4775ED(v7); - return v2->field_10 != 0; + return v2->uNumVertices != 0; } //----- (0047802A) -------------------------------------------------------- @@ -4354,7 +4349,7 @@ v16 = 0; if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) { - for(int i = 0; i < a1->field_10; i++) + for(int i = 0; i < a1->uNumVertices; i++) { v6 = (double)pBLVRenderParams->field_40 * 0.000015258789 / a1->field_B4[i*4]; if ( pRenderer->pRenderD3D ) @@ -4385,7 +4380,7 @@ } else { - for(int i = 0; i < a1->field_10; i++) + for(int i = 0; i < a1->uNumVertices; i++) { v12 = (double)pOutdoorCamera->int_fov_rad / a1->field_B4[i*4]; a1->field_B4[i*4+20] = (double)pViewport->uScreenCenterX - v12 * a1->field_B4[i*4+1]; @@ -6118,431 +6113,6 @@ //} } -//----- (00479A53) -------------------------------------------------------- -void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID) -{ - BLVFace *pFace; // esi@1 - unsigned int v3; // edi@1 - PolygonType v4; // al@1 - double v5; // st7@3 - signed __int64 v6; // qax@3 - PolygonType v7; // cl@3 - int v8; // esi@7 - int v9; // eax@7 - unsigned int v10; // eax@7 - double v11; // st6@7 - int v12; // edx@7 - int v13; // eax@7 - char *v14; // esi@8 - void *v15; // ecx@9 - int v16; // eax@9 - int v17; // edi@9 - double v18; // st7@9 - signed int v19; // ebx@9 - void *v20; // ecx@9 - int v21; // ebx@11 - int v22; // eax@14 - signed __int64 v23; // qtt@16 - double v24; // st7@16 - unsigned __int8 v25; // sf@16 - unsigned __int8 v26; // of@16 - Render *v27; // ecx@17 - double v28; // st7@20 - char *v29; // ebx@20 - char *v30; // edx@20 - unsigned __int8 v31; // c0@21 - unsigned __int8 v32; // c3@21 - double v33; // st6@23 - char *v34; // esi@30 - const void *v35; // ecx@31 - int v36; // eax@31 - const void *v37; // edi@31 - signed __int64 v38; // qax@31 - int v39; // ecx@31 - int v40; // ebx@33 - int v41; // eax@36 - signed __int64 v42; // qtt@39 - int v43; // eax@39 - char v44; // zf@39 - double v45; // st7@39 - double v46; // st7@39 - unsigned int v47; // edx@40 - double v48; // st7@41 - RenderVertexSoft *v49; // ebx@41 - void *v50; // edi@43 - double v51; // st7@46 - RenderVertexSoft *v52; // edx@46 - void *v53; // edi@48 - char *v54; // ebx@52 - unsigned int v55; // eax@53 - unsigned int v56; // eax@55 - int v57; // ST10_4@55 - Texture *v58; // eax@55 - signed int v59; // [sp-4h] [bp-178h]@17 - stru148 *v60; // [sp+0h] [bp-174h]@17 - IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17 - stru148 v62; // [sp+14h] [bp-160h]@6 - unsigned int v63; // [sp+120h] [bp-54h]@7 - double v64; // [sp+124h] [bp-50h]@7 - unsigned int v65; // [sp+128h] [bp-4Ch]@1 - unsigned int v66; // [sp+12Ch] [bp-48h]@7 - float v67; // [sp+130h] [bp-44h]@7 - __int64 v68; // [sp+134h] [bp-40h]@3 - __int64 v69; // [sp+13Ch] [bp-38h]@3 - int v70; // [sp+144h] [bp-30h]@3 - int X; // [sp+148h] [bp-2Ch]@9 - int v72; // [sp+14Ch] [bp-28h]@7 - float v73; // [sp+150h] [bp-24h]@16 - unsigned int v74; // [sp+154h] [bp-20h]@3 - RenderVertexSoft *v75; // [sp+158h] [bp-1Ch]@3 - float v76; // [sp+15Ch] [bp-18h]@9 - int v77; // [sp+160h] [bp-14h]@9 - int v78; // [sp+164h] [bp-10h]@7 - void *v79; // [sp+168h] [bp-Ch]@9 - float v80; // [sp+16Ch] [bp-8h]@3 - const void *v81; // [sp+170h] [bp-4h]@7 - - __debugbreak(); - - pFace = &pIndoor->pFaces[uFaceID]; - v65 = uFaceID; - v3 = uNumVertices; - v4 = pFace->uPolygonType; - if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor ) - { - if ( (signed int)uNumVertices > 0 ) - { - v54 = (char *)&array_507D30[0].u; - LODWORD(v80) = uNumVertices; - do - { - v69 = (GetTickCount() >> 5) - pBLVRenderParams->vPartyPos.x; - *(float *)v54 = (double)v69 + *(float *)v54; - *(float *)v54 = *(float *)v54 * 0.25; - v55 = GetTickCount(); - v54 += 48; - v44 = LODWORD(v80)-- == 1; - v68 = pBLVRenderParams->vPartyPos.y + (v55 >> 5); - *((float *)v54 - 11) = ((double)v68 + *((float *)v54 - 11)) * 0.25; - } - while ( !v44 ); - uFaceID = v65; - } - v56 = 8 * uFaceID; - LOBYTE(v56) = PID(OBJECT_BModel,uFaceID); - v57 = v56; - v58 = pFace->GetTexture(); - pRenderer->DrawIndoorPolygon(v3, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], v58, v57, -1, 0); - return; - } - HIDWORD(v69) = pIndoorCamera->sRotationX; - HIDWORD(v68) = pIndoorCamera->pos.z; - *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY; - v70 = (signed __int64)((double)(pBLVRenderParams->field_40 * pBLVRenderParams->vPartyPos.z) - / (((double)pBLVRenderParams->field_40 + 16192.0) - * 65536.0) - + *(float *)&v74); - v5 = (double)pIndoorCamera->sRotationX * 0.0030664064; - *(float *)&v75 = v5; - v80 = cos(v5) * 16192.0; - v6 = (signed __int64)(*(float *)&v74 - - (double)pBLVRenderParams->field_40 - / ((v80 + 0.0000001) - * 65535.0) - * (sin(*(float *)&v75) * -16192.0 - (double)SHIDWORD(v68))); - v7 = pFace->uPolygonType; - if ( v7 == 4 || v7 == 3 ) - v70 = v6; - stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0); - v62._48607B(&stru_8019C8); - v62.uTileBitmapID = pFace->uBitmapID; - v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? &pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0); - if ( !v62.pTexture ) - return; - v8 = pBLVRenderParams->sPartyRotX; - v62.dimming_level = 0; - v62.uNumVertices = v3; - v9 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotX + 16); - v62.v_18.y = 0; - v62.v_18.x = -v9; - v62.v_18.z = -stru_5C6E00->Cos(v8 + 16); - v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX; - memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3])); - LODWORD(v80) = v10; - v62.field_24 = 33554432; - v64 = (double)(signed int)v10 * 0.5; - v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5); - LODWORD(v80) = v62.pTexture->uTextureWidth; - v11 = 1.0 / (double)SLODWORD(v80); - LODWORD(v80) = v62.pTexture->uTextureHeight; - v12 = v62.pTexture->uWidthMinus1; - v13 = v62.pTexture->uHeightMinus1; - v67 = v11; - v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13; - v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12; - v78 = 0; - v81 = 0; - *((float *)&v68 + 1) = 1.0 / (double)SLODWORD(v80); - if ( (signed int)v62.uNumVertices <= 0 ) - { -LABEL_17: - v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]; - v27 = pRenderer; - v60 = &v62; - v59 = v62.uNumVertices; - goto LABEL_18; - } - v14 = (char *)&array_507D30[0].vWorldViewProjY; - while ( 2 ) - { - v15 = (void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v14)); - LODWORD(v80) = v62.ptr_38->field_14; - v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16; - v16 = v77 + v62.ptr_38->field_C; - v77 = (int)v15; - v74 = v16; - LODWORD(v80) = v62.ptr_38->field_20; - v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16; - v79 = v15; - v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->field_18); - LODWORD(v80) = v62.v_18.z; - v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16); - v17 = v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v14 - 1)); - v18 = *(float *)v14 - 1.0; - v19 = -v62.field_24; - v77 = -v62.field_24; - X = (int)((char *)v79 + v62.v_18.x); - LODWORD(v76) = (signed __int64)v18; - v20 = (void *)(v72 * (v70 - LODWORD(v76))); - while ( 1 ) - { - v79 = v20; - if ( !X ) - goto LABEL_14; - v21 = abs(v19 >> 14); - if ( v21 <= abs(X) ) - break; - if ( SLODWORD(v76) <= (signed int)pViewport->uViewportTL_Y ) - break; - v19 = v77; - v20 = v79; -LABEL_14: - LODWORD(v80) = v62.v_18.z; - v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16); - v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16; - --LODWORD(v76); - v20 = (char *)v20 + v72; - X = v22 + v62.v_18.x; - v78 = 1; - } - if ( !v78 ) - { - LODWORD(v23) = v77 << 16; - HIDWORD(v23) = v77 >> 16; - v79 = (void *)(v23 / X); - v77 = v17; - LODWORD(v80) = v62.ptr_38->field_10; - v77 = v17; - LODWORD(v76) = v74 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16); - LODWORD(v80) = v62.ptr_38->field_1C; - v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16)); - v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16; - LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16; - v14 += 48; - LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4); - v81 = (char *)v81 + 1; - v24 = (double)SLODWORD(v80) * 0.000015259022; - LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4); - v26 = __OFSUB__((int)v81, v62.uNumVertices); - v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0; - *((float *)v14 - 10) = v24 * v67; - *((float *)v14 - 9) = (double)SLODWORD(v80) * 0.000015259022 * *((float *)&v68 + 1); - *((float *)v14 - 11) = 65536.0 / (double)(signed int)v79; - if ( !(v25 ^ v26) ) - goto LABEL_17; - continue; - } - break; - } - LODWORD(v73) = 0; - v80 = v76; - if ( (signed int)v62.uNumVertices > 0 ) - { - v28 = (double)SLODWORD(v76); - LODWORD(v76) = (int)(char *)array_50AC10 + 28; - v29 = (char *)&array_50AC10[0].vWorldViewProjX; - v30 = (char *)&array_507D30[1].vWorldViewProjY; - v79 = array_50AC10; - v81 = array_507D30; - v78 = v62.uNumVertices; - do - { - v31 = v28 < *((float *)v30 - 12); - v32 = v28 == *((float *)v30 - 12); - ++LODWORD(v73); - memcpy(v79, v81, 0x30u); - v79 = (char *)v79 + 48; - LODWORD(v76) += 48; - v29 += 48; - if ( v31 | v32 || v28 >= *(float *)v30 ) - { - if ( v28 >= *((float *)v30 - 12) || v28 <= *(float *)v30 ) - goto LABEL_28; - v33 = (*((float *)v30 - 1) - *((float *)v30 - 13)) * v28 / (*(float *)v30 - *((float *)v30 - 12)) - + *((float *)v30 - 1); - } - else - { - v33 = (*((float *)v30 - 13) - *((float *)v30 - 1)) * v28 / (*((float *)v30 - 12) - *(float *)v30) - + *((float *)v30 - 13); - } - *(float *)v29 = v33; - v79 = (char *)v79 + 48; - v29 += 48; - ++LODWORD(v73); - *(unsigned int *)LODWORD(v76) = v28; - LODWORD(v76) += 48; -LABEL_28: - v81 = (char *)v81 + 48; - v30 += 48; - --v78; - } - while ( v78 ); - } - if ( SLODWORD(v73) <= 0 ) - goto LABEL_40; - v34 = (char *)&array_50AC10[0].vWorldViewProjY; - v65 = v77 >> 14; - HIDWORD(v69) = LODWORD(v73); - do - { - v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34)); - v78 = v62.ptr_38->field_14; - v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16); - v36 = (int)((char *)v81 + v62.ptr_38->field_C); - v81 = v35; - v74 = v36; - v78 = v62.ptr_38->field_20; - v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16); - v78 = (int)v35; - v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->field_18); - v81 = (const void *)v62.v_18.z; - v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16; - v37 = (const void *)(v72 - * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1))); - v38 = (signed __int64)(*(float *)v34 - 1.0); - v81 = 0; - LODWORD(v76) = v38; - v39 = v72 * (v70 - v38); - while ( 1 ) - { - v78 = v39; - if ( !X ) - goto LABEL_36; - v40 = abs(X); - if ( abs((signed __int64)v65) <= v40 ) - break; - if ( SLODWORD(v76) <= (signed int)pViewport->uViewportTL_Y ) - break; - v39 = v78; -LABEL_36: - v78 = v62.v_18.z; - v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16; - --LODWORD(v76); - v39 += v72; - X = v41 + v62.v_18.x; - v81 = (const void *)1; - } - if ( v81 ) - { - v79 = (void *)v62.v_18.z; - v78 = 2 * LODWORD(v76); - v81 = (const void *)((unsigned __int64)(v62.v_18.z - * (signed __int64)(signed int)(signed __int64)(((double)v70 - - ((double)(2 * LODWORD(v76)) - - *(float *)v34)) - * (double)v72)) >> 16); - X = (int)((char *)v81 + v62.v_18.x); - } - LODWORD(v42) = v77 << 16; - HIDWORD(v42) = v77 >> 16; - v79 = (void *)(v42 / X); - v81 = v37; - v78 = v62.ptr_38->field_10; - v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16); - v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16); - v74 = (unsigned int)v37; - LODWORD(v76) = v43; - v78 = v62.ptr_38->field_1C; - v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16)); - v74 = (unsigned __int64)(v43 * v42 / X) >> 16; - v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16); - v34 += 48; - v78 = v66 + ((signed int)v74 >> 4); - v44 = HIDWORD(v69)-- == 1; - v45 = (double)v78 * 0.000015259022; - v78 = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v42 / X) >> 16) >> 4); - *((float *)v34 - 10) = v45 * v67; - *((float *)v34 - 9) = (double)v78 * 0.000015259022 * *((float *)&v68 + 1); - v46 = (double)(signed int)v79; - *((float *)v34 - 16) = 0.000015258789 * v46; - *((float *)v34 - 11) = 65536.0 / v46; - } - while ( !v44 ); -LABEL_40: - v47 = 0; - if ( SLODWORD(v73) > 0 ) - { - v48 = (double)SLODWORD(v80); - v75 = array_507D30; - v49 = array_50AC10; - HIDWORD(v69) = LODWORD(v73); - do - { - if ( v48 >= v49->vWorldViewProjY ) - { - v50 = v75; - ++v47; - ++v75; - memcpy(v50, v49, 0x30u); - } - ++v49; - --HIDWORD(v69); - } - while ( HIDWORD(v69) ); - } - v62.uNumVertices = v47; - pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]); - *(float *)&v74 = 0.0; - if ( SLODWORD(v73) > 0 ) - { - v51 = (double)SLODWORD(v80); - v75 = array_507D30; - v52 = array_50AC10; - v80 = v73; - do - { - if ( v51 <= v52->vWorldViewProjY ) - { - v53 = v75; - ++v74; - ++v75; - memcpy(v53, v52, 0x30u); - } - ++v52; - --LODWORD(v80); - } - while ( v80 != 0.0 ); - } - v62.uNumVertices = v74; - v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]; - v60 = &v62; - v59 = v74; - v27 = pRenderer; -LABEL_18: - v27->_4A2ED5(v59, v60, v61); -} - //----- (0047A384) -------------------------------------------------------- void ODM_LoadAndInitialize(const char *pLevelFilename, OutdoorCamera *thisa) {