Mercurial > might-and-magic-trilogy
diff mm7_3.cpp @ 59:5159d2e6f559
BLV render
author | Nomad |
---|---|
date | Fri, 26 Oct 2012 02:38:26 +0200 |
parents | 41cbaabde2cb |
children | fdacbc653945 |
line wrap: on
line diff
--- a/mm7_3.cpp Thu Oct 25 02:05:16 2012 +0200 +++ b/mm7_3.cpp Fri Oct 26 02:38:26 2012 +0200 @@ -346,7 +346,7 @@ f.pFacePlane_old.vNormal.z = v4->pFacePlane.vNormal.z; v6 = v4->pFacePlane.dist; f.pFacePlane_old.dist = v4->pFacePlane.dist; - v7 = v4->uFaceAttributes; + v7 = v4->uAttributes; f.uAttributes = v7; f.pBounding.x1 = v4->pBoundingBox.x1; f.pBounding.y1 = v4->pBoundingBox.y1; @@ -1274,7 +1274,7 @@ case 6: v40 = &pOutdoor->pBModels[v38 >> 9]; v41 = &v40->pFaces[v39 & 0x3F]; - if ( !(BYTE3(v41->uFaceAttributes) & 0x20) ) + if ( !(BYTE3(v41->uAttributes) & 0x20) ) { v42 = v41->uPolygonType; if ( v42 == 3 ) @@ -2127,7 +2127,7 @@ } v1->vVelocity.z += v37; LABEL_70: - if ( BYTE3(v32->uFaceAttributes) & 0x10 ) + if ( BYTE3(v32->uAttributes) & 0x10 ) EventProcessor(v32->sCogTriggeredID, 0, 1); goto LABEL_74; } @@ -2679,7 +2679,8 @@ * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)(v88 * fWalkSpeedMultiplier))) >> 16; - goto LABEL_70; + v72 = 1; + goto LABEL_87; case PARTY_RunBackward: v32 = stru_5C6E00->SinCos(angle); v33 = (double)v81; @@ -2689,7 +2690,7 @@ v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); v1 -= (unsigned __int64)(v34 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16; -LABEL_70: +//LABEL_70: v72 = 1; goto LABEL_87; case PARTY_LookUp: @@ -3857,7 +3858,7 @@ LABEL_220: v45 = stru_721530.uFaceID; LABEL_221: - if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uFaceAttributes) & 4 ) + if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uAttributes) & 4 ) { pParty->field_6F4_packedid = v45; v103 = v47->sCogTriggeredID; @@ -3902,7 +3903,7 @@ if ( v114 && (!bJumping || v101) ) { if ( !v107 - && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20) ) + && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20) ) { v96 = 0; v94 = 0; @@ -3931,7 +3932,7 @@ if ( v124 && (!bJumping || v101) ) { if ( v107 - || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20 ) + || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20 ) { v96 = 0; v94 = 0; @@ -6798,7 +6799,7 @@ } while ( 1 ) { - if ( pFace->uFaceAttributes & 0x2000 ) + if (pFace->Invisible()) goto LABEL_85; v5 = (int)*(v2 - 1); v6 = pFace->pVertexIDs[0]; @@ -6808,7 +6809,7 @@ *(int *)&v7->flags = 0; pLightmapBuilder = v8; v9 = pFace->uTextureID; - v10 = (BYTE1(pFace->uFaceAttributes) & 0x40) == 0; + v10 = (BYTE1(pFace->uAttributes) & 0x40) == 0; v48 = pFace->uTextureID; if ( !v10 ) { @@ -6820,14 +6821,14 @@ v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24); v49 = v12; v49 = pFaceTexture->uTextureHeight; - v10 = (pFace->uFaceAttributes & 0x10) == 0; + v10 = (pFace->uAttributes & 0x10) == 0; v45 = 1.0 / (double)v12; v44 = 1.0 / (double)v49; if ( !v10 ) *(int *)&v7->flags |= 2u; - if ( BYTE2(pFace->uFaceAttributes) & 0x40 ) + if ( BYTE2(pFace->uAttributes) & 0x40 ) HIBYTE(v7->flags) |= 4u; - v13 = pFace->uFaceAttributes; + v13 = pFace->uAttributes; if ( v13 & 4 ) { HIBYTE(v7->flags) |= 4u; @@ -6837,7 +6838,7 @@ if ( v13 & 0x20 ) HIBYTE(v7->flags) |= 8u; } - v14 = pFace->uFaceAttributes; + v14 = pFace->uAttributes; if ( BYTE1(v14) & 8 ) { *(int *)&v7->flags |= 0x2000u; @@ -6927,7 +6928,7 @@ } else { - v47->_436BB7_project_and_stuff((RenderVertexSoft *)(v23 - 12), 1u, 0); + v47->Project((RenderVertexSoft *)(v23 - 12), 1u, 0); } v23 += 48; --v51; @@ -7006,7 +7007,7 @@ pDecalBuilder->ApplyDecals_OutdoorFace(pFace); v31->std__vector_000004_size = 0; LOBYTE(v31) = 0; - if ( stru_F8AD28.field_AC > 0 || pDecalBuilder->uNumDecals > 0 ) + if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 ) { v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0); static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1); @@ -7028,7 +7029,7 @@ -1); } } - if ( stru_F8AD28.field_AC > 0 ) + if ( stru_F8AD28.uNumLightsApplied > 0 ) pLightmapBuilder->ApplyLights( &stru_F8AD28, &static_RenderBuildingsD3D_stru_73C834, @@ -7242,7 +7243,7 @@ } else { - pGame->pIndoorCameraD3D->_436BB7_project_and_stuff((RenderVertexSoft *)(v9 - 12), 1u, 0); + pGame->pIndoorCameraD3D->Project((RenderVertexSoft *)(v9 - 12), 1u, 0); } v81 += 2; v9 += 48; @@ -7374,7 +7375,7 @@ }*/ pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3); - if ( stru_F8AD28.field_AC <= 0 ) + if ( stru_F8AD28.uNumLightsApplied <= 0 ) { v12->field_108 = 0; } @@ -7384,9 +7385,9 @@ v12->field_108 = 1; static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35); - v55 = static_sub_004789DE_stru_73C818.vNormal.x; - v56 = static_sub_004789DE_stru_73C818.vNormal.y; - v57 = static_sub_004789DE_stru_73C818.vNormal.z; + v55 = static_sub_004789DE_stru_73C818.face_plane.vNormal.x; + v56 = static_sub_004789DE_stru_73C818.face_plane.vNormal.y; + v57 = static_sub_004789DE_stru_73C818.face_plane.vNormal.z; pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55); } if ( v74 ) @@ -13064,10 +13065,10 @@ else { v17 = &pGame->pIndoorCameraD3D; - v15->flt_8 = pGame->pIndoorCameraD3D->flt_D0; - v18 = (*v17)->flt_D4; - v19 = v15->flt_8; - v15->flt_C = v18; + v15->fov_x = pGame->pIndoorCameraD3D->fov_x; + v18 = (*v17)->fov_y; + v19 = v15->fov_x; + v15->fov_y = v18; v31 = v19; v25 = v19 + 6.7553994e15; LODWORD(v20) = 0; @@ -13076,7 +13077,7 @@ LODWORD(v31) = v12->scale; v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; - v31 = v15->flt_C; + v31 = v15->fov_y; v25 = v31 + 6.7553994e15; LODWORD(v20) = 0; HIDWORD(v20) = SLOWORD(v25); @@ -13218,7 +13219,7 @@ v1->uParticleTrailColorR, v1->uParticleTrailColorG, v1->uParticleTrailColorB, - v11); + byte_4E94D3); } if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( a1, @@ -13248,9 +13249,9 @@ } else { - v3->flt_8 = pGame->pIndoorCameraD3D->flt_D0; - v3->flt_C = pGame->pIndoorCameraD3D->flt_D4; - v18 = (int)floorf(v3->flt_8 + 0.5f) / x; + v3->fov_x = pGame->pIndoorCameraD3D->fov_x; + v3->fov_y = pGame->pIndoorCameraD3D->fov_y; + v18 = (int)floorf(v3->fov_x + 0.5f) / x; v3->field_0 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16; v31 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16; } @@ -13767,7 +13768,7 @@ int a3a; // [sp+44h] [bp-10h]@40 signed int uCenterY; // [sp+48h] [bp-Ch]@1 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 - signed int uZb; // [sp+5Ch] [bp+8h]@27 + //signed int uZb; // [sp+5Ch] [bp+8h]@27 signed int uWidth; // [sp+5Ch] [bp+8h]@30 signed int uZd; // [sp+5Ch] [bp+8h]@45 signed int uZe; // [sp+5Ch] [bp+8h]@67 @@ -13914,17 +13915,15 @@ auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; - if (~pFace1->uAttributes & 0x2000) - { //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; - if (~pFace2->uAttributes & 0x2000) - { - v11 = pOutline->uFlags; - if ( v11 & 1 ) - goto LABEL_15; - if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 ) - goto LABEL_ABC; - } + if (pFace1->Visible() && pFace2->Visible()) + { + v11 = pOutline->uFlags; + if ( v11 & 1 ) + goto LABEL_15; + if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 ) + goto LABEL_ABC; + } continue; @@ -13959,10 +13958,10 @@ } - for ( uZb = 0; uZb < (signed int)uNumBlueFacesInBLVMinimap; ++uZb ) + for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) { //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; - auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; + auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; pRenderer->Line2D( uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom @@ -14046,7 +14045,8 @@ if ( bWizardEyeActive ) { uZe = 0; - if ( (signed int)uNumLayingItems > 0 ) + //for (uint i = 0; i < uNumLayingItems; ++i) + if (uNumLayingItems > 0) { a2c = (char *)&pLayingItems[0].uObjectDescID; while ( 1 ) @@ -14207,14 +14207,14 @@ pRenderer->DrawTextureTransparent( 0x1D4u, v33, - (Texture *)(dword_5079D8 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079D8] : 0)); + (Texture *)(dword_5079D8 != -1 ? &pIcons_LOD->pTextures[dword_5079D8] : 0)); uZooma = (double)pParty->sRotationY * 0.1171875; v50 = uZooma + 6.7553994e15; pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u); pRenderer->DrawTextureIndexed( LODWORD(v50) + 285, 0x88u, - (Texture *)(dword_5079B4 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079B4] : 0)); + (Texture *)(dword_5079B4 != -1 ? &pIcons_LOD->pTextures[dword_5079B4] : 0)); pRenderer->ResetClip(); } @@ -15666,13 +15666,13 @@ v13 = v12->sCogTriggeredID; if ( v13 ) { - if ( !(BYTE2(v12->uFaceAttributes) & 0x10) ) + if ( !(BYTE2(v12->uAttributes) & 0x10) ) { v14 = _444732_GetEventHintString(v13); v15 = v14; if ( v14 ) { - if ( _strcmpi(v14, nullstring) ) + if ( _strcmpi(v14, "") ) v21 = (char *)v15; } } @@ -15767,13 +15767,13 @@ v12 = v11->sCogTriggeredID; if ( v12 ) { - if ( !(BYTE2(v11->uFaceAttributes) & 0x10) ) + if ( !(BYTE2(v11->uAttributes) & 0x10) ) { v13 = _444732_GetEventHintString(v12); v14 = v13; if ( v13 ) { - if ( _strcmpi(v13, nullstring) ) + if ( _strcmpi(v13, "") ) v17 = v14; } } @@ -15865,12 +15865,12 @@ v1 = pTmpBuf; goto LABEL_12; } - v1 = nullstring; + v1 = ""; } if ( !v1 ) { MessageBoxW(nullptr, L"No transition text found!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1410", 0); - v1 = nullstring; + v1 = ""; } LABEL_12: v7 = 3; @@ -16082,10 +16082,10 @@ dword_5C341C = v3; _591094_decoration = _5C3420_pDecoration; pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0); - pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, nullstring, 0); - pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, nullstring, 0); - pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, nullstring, 0); - pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, nullstring, 0); + pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); } } @@ -16409,7 +16409,7 @@ v24 = (&dword_721660)[8 * v23]; if ( !v24 ) { - v24 = nullstring; + v24 = ""; v15->uControlParam = 0; } goto LABEL_79; @@ -16453,7 +16453,7 @@ goto LABEL_63; } LABEL_71: - v24 = nullstring; + v24 = ""; goto LABEL_79; } if ( v0->uFlags & 0x80 ) @@ -17163,7 +17163,7 @@ { //v5 = pSomeEVT; //v6 = v123; - //v7 = nullstring; + //v7 = ""; //while ( 1 ) //{ if ( dword_5B65C4 ) @@ -17528,7 +17528,7 @@ //v4 = v124; //v5 = pSomeEVT; //v6 = v123; - //v7 = nullstring; + //v7 = ""; break; case EVENT_CharacterAnimation: v54 = _evt->v5; @@ -18299,7 +18299,7 @@ v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4)); if ( v10->sCogNumber == v14 ) { - if ( BYTE1(v10->uFaceAttributes) & 0x40 ) + if ( BYTE1(v10->uAttributes) & 0x40 ) { *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName( Str2); @@ -18466,9 +18466,9 @@ if ( v9->sCogNumber == v10 ) { if ( on ) - v9->uFaceAttributes |= bit; + v9->uAttributes |= bit; else - v9->uFaceAttributes &= ~bit; + v9->uAttributes &= ~bit; } ++v8; v6 += 308; @@ -21221,16 +21221,13 @@ } //----- (0040471C) -------------------------------------------------------- -int stru262_TurnBased::_40471C() -{ - int result; // eax@3 - +void stru262_TurnBased::_40471C() +{ if ( pParty->bTurnBasedModeOn == 1 ) { if ( pTurnEngine->field_4 == 2 ) - result = _406457(0); - } - return result; + _406457(0); + } }