Mercurial > mm7
comparison mm7_3.cpp @ 1206:ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
author | Grumpy7 |
---|---|
date | Sun, 09 Jun 2013 01:10:49 +0200 |
parents | 8c02e6f74b29 |
children | 96a81634669e |
comparison
equal
deleted
inserted
replaced
1205:8c02e6f74b29 | 1206:ab6560001f5b |
---|---|
4663 uNumVertices = v18; | 4663 uNumVertices = v18; |
4664 if ( v18 > 0 ) | 4664 if ( v18 > 0 ) |
4665 { | 4665 { |
4666 //v19 = (char *)&array_73D150[0].vWorldPosition.z; | 4666 //v19 = (char *)&array_73D150[0].vWorldPosition.z; |
4667 //v20 = (char *)pFace->pTextureUIDs; | 4667 //v20 = (char *)pFace->pTextureUIDs; |
4668 v19 = array_73D150; | 4668 v19 = array_73D150.data(); |
4669 v20 = pFace->pTextureUIDs; | 4669 v20 = pFace->pTextureUIDs; |
4670 v20b = pFace->pVertexIDs; | 4670 v20b = pFace->pVertexIDs; |
4671 v20c = pFace->pTextureVIDs; | 4671 v20c = pFace->pTextureVIDs; |
4672 v51 = v18; | 4672 v51 = v18; |
4673 do | 4673 do |
4705 //*((float *)v19 - 4) = (double)v22 * v44; | 4705 //*((float *)v19 - 4) = (double)v22 * v44; |
4706 (v19-1)->v = (double)v22 * v44; | 4706 (v19-1)->v = (double)v22 * v44; |
4707 } | 4707 } |
4708 while ( !v10 ); | 4708 while ( !v10 ); |
4709 //v23 = (char *)&array_73D150[0].vWorldViewPosition; | 4709 //v23 = (char *)&array_73D150[0].vWorldViewPosition; |
4710 v23 = array_73D150; | 4710 v23 = array_73D150.data(); |
4711 v51 = uNumVertices; | 4711 v51 = uNumVertices; |
4712 *(float *)&pLightmapBuilder = (double)(signed int)pLightmapBuilder; | 4712 *(float *)&pLightmapBuilder = (double)(signed int)pLightmapBuilder; |
4713 do | 4713 do |
4714 { | 4714 { |
4715 //if ( *(float *)&pLightmapBuilder == *((float *)v23 - 1) ) | 4715 //if ( *(float *)&pLightmapBuilder == *((float *)v23 - 1) ) |
4758 v7->dimming_level = 31; | 4758 v7->dimming_level = 31; |
4759 if ( pOutdoorCamera->numStru148s >= 1999 + 5000) | 4759 if ( pOutdoorCamera->numStru148s >= 1999 + 5000) |
4760 return result; | 4760 return result; |
4761 ++pOutdoorCamera->numStru148s; | 4761 ++pOutdoorCamera->numStru148s; |
4762 ++pOutdoorCamera->field_44; | 4762 ++pOutdoorCamera->field_44; |
4763 if ( ODMFace::IsBackfaceCulled(pFace, array_73D150, v7) ) | 4763 if ( ODMFace::IsBackfaceCulled(pFace, array_73D150.data(), v7) ) |
4764 { | 4764 { |
4765 LOBYTE(v25) = (char)v54; | 4765 LOBYTE(v25) = (char)v54; |
4766 v26 = a1; | 4766 v26 = a1; |
4767 pFace->bVisible = 1; | 4767 pFace->bVisible = 1; |
4768 v7->uBModelFaceID = v25; | 4768 v7->uBModelFaceID = v25; |
4812 if ( pDecalBuilder->uNumDecals > 0 ) | 4812 if ( pDecalBuilder->uNumDecals > 0 ) |
4813 { | 4813 { |
4814 v40 = -1; | 4814 v40 = -1; |
4815 v39 = v31; | 4815 v39 = v31; |
4816 v38 = 0; | 4816 v38 = 0; |
4817 v37 = array_50AC10; | 4817 v37 = array_50AC10.data(); |
4818 v36 = uNumVertices; | 4818 v36 = uNumVertices; |
4819 pDecalBuilder->ApplyDecals(31 - v7->dimming_level, | 4819 pDecalBuilder->ApplyDecals(31 - v7->dimming_level, |
4820 2, | 4820 2, |
4821 &static_RenderBuildingsD3D_stru_73C834, | 4821 &static_RenderBuildingsD3D_stru_73C834, |
4822 uNumVertices, | 4822 uNumVertices, |
4823 array_50AC10, | 4823 array_50AC10.data(), |
4824 0, | 4824 0, |
4825 (char)v31, | 4825 (char)v31, |
4826 -1); | 4826 -1); |
4827 } | 4827 } |
4828 } | 4828 } |
4829 if ( stru_F8AD28.uNumLightsApplied > 0 ) | 4829 if ( stru_F8AD28.uNumLightsApplied > 0 ) |
4830 pLightmapBuilder->ApplyLights( | 4830 pLightmapBuilder->ApplyLights( |
4831 &stru_F8AD28, | 4831 &stru_F8AD28, |
4832 &static_RenderBuildingsD3D_stru_73C834, | 4832 &static_RenderBuildingsD3D_stru_73C834, |
4833 uNumVertices, | 4833 uNumVertices, |
4834 array_50AC10, | 4834 array_50AC10.data(), |
4835 0, | 4835 0, |
4836 (char)v31); | 4836 (char)v31); |
4837 if ( v50 ) | 4837 if ( v50 ) |
4838 { | 4838 { |
4839 v32 = sr_424CD7(uNumVertices); | 4839 v32 = sr_424CD7(uNumVertices); |
5089 v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0); | 5089 v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0); |
5090 if ( !(v18 ^ v19) ) | 5090 if ( !(v18 ^ v19) ) |
5091 return result; | 5091 return result; |
5092 ++pOutdoorCamera->numStru148s; | 5092 ++pOutdoorCamera->numStru148s; |
5093 ++pOutdoorCamera->field_44; | 5093 ++pOutdoorCamera->field_44; |
5094 if ( !ODMFace::IsBackfaceCulled(v3, array_73D150, v12) ) | 5094 if ( !ODMFace::IsBackfaceCulled(v3, array_73D150.data(), v12) ) |
5095 { | 5095 { |
5096 LABEL_71: | 5096 LABEL_71: |
5097 --pOutdoorCamera->numStru148s; | 5097 --pOutdoorCamera->numStru148s; |
5098 --pOutdoorCamera->field_44; | 5098 --pOutdoorCamera->field_44; |
5099 goto LABEL_72; | 5099 goto LABEL_72; |
5183 | 5183 |
5184 static_sub_004789DE_stru_73C818.GetFacePlaneAndClassify((ODMFace *)v3, v35); | 5184 static_sub_004789DE_stru_73C818.GetFacePlaneAndClassify((ODMFace *)v3, v35); |
5185 v55 = static_sub_004789DE_stru_73C818.face_plane.vNormal.x; | 5185 v55 = static_sub_004789DE_stru_73C818.face_plane.vNormal.x; |
5186 v56 = static_sub_004789DE_stru_73C818.face_plane.vNormal.y; | 5186 v56 = static_sub_004789DE_stru_73C818.face_plane.vNormal.y; |
5187 v57 = static_sub_004789DE_stru_73C818.face_plane.vNormal.z; | 5187 v57 = static_sub_004789DE_stru_73C818.face_plane.vNormal.z; |
5188 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55); | 5188 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10.data(), v26, (Vec3_float_ *)&v55); |
5189 } | 5189 } |
5190 if ( v74 ) | 5190 if ( v74 ) |
5191 { | 5191 { |
5192 v36 = sr_4250FE(v26); | 5192 v36 = sr_4250FE(v26); |
5193 v37 = v36; | 5193 v37 = v36; |
5271 } | 5271 } |
5272 while ( v51 < (signed int)v12->uNumVertices ); | 5272 while ( v51 < (signed int)v12->uNumVertices ); |
5273 } | 5273 } |
5274 } | 5274 } |
5275 } | 5275 } |
5276 sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638.data(), dword_50B570.data(), v12); | 5276 sr_sub_486B4E_push_outdoor_edges(array_508690.data(), dword_50B638.data(), dword_50B570.data(), v12); |
5277 } | 5277 } |
5278 LABEL_72: | 5278 LABEL_72: |
5279 ++v79; | 5279 ++v79; |
5280 v1 = v78; | 5280 v1 = v78; |
5281 ++v3; | 5281 ++v3; |
5432 v14 = (double)pOutdoor->vSunlight.x / 65536.0; | 5432 v14 = (double)pOutdoor->vSunlight.x / 65536.0; |
5433 result = 0; | 5433 result = 0; |
5434 v1 = (unsigned int)&array_77EC08[pOutdoorCamera->numStru148s]; | 5434 v1 = (unsigned int)&array_77EC08[pOutdoorCamera->numStru148s]; |
5435 v15 = (double)pOutdoor->vSunlight.y / 65536.0; | 5435 v15 = (double)pOutdoor->vSunlight.y / 65536.0; |
5436 v16 = (double)pOutdoor->vSunlight.z / 65536.0; | 5436 v16 = (double)pOutdoor->vSunlight.z / 65536.0; |
5437 if ( v1 > (unsigned int)array_77EC08 ) | 5437 if ( v1 > (unsigned int)array_77EC08.data() ) |
5438 { | 5438 { |
5439 v2 = (char *)&array_77EC08[0].pODMFace; | 5439 v2 = (char *)&array_77EC08[0].pODMFace; |
5440 while ( 1 ) | 5440 while ( 1 ) |
5441 { | 5441 { |
5442 v3 = v2[5]; | 5442 v3 = v2[5]; |
6317 v9 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotX + 16); | 6317 v9 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotX + 16); |
6318 v62.v_18.y = 0; | 6318 v62.v_18.y = 0; |
6319 v62.v_18.x = -v9; | 6319 v62.v_18.x = -v9; |
6320 v62.v_18.z = -stru_5C6E00->Cos(v8 + 16); | 6320 v62.v_18.z = -stru_5C6E00->Cos(v8 + 16); |
6321 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX; | 6321 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX; |
6322 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3])); | 6322 memcpy(&array_507D30[v3], array_507D30.data(), sizeof(array_507D30[v3])); |
6323 LODWORD(v80) = v10; | 6323 LODWORD(v80) = v10; |
6324 v62.field_24 = 33554432; | 6324 v62.field_24 = 33554432; |
6325 v64 = (double)(signed int)v10 * 0.5; | 6325 v64 = (double)(signed int)v10 * 0.5; |
6326 v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5); | 6326 v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5); |
6327 LODWORD(v80) = v62.pTexture->uTextureWidth; | 6327 LODWORD(v80) = v62.pTexture->uTextureWidth; |
6419 LODWORD(v73) = 0; | 6419 LODWORD(v73) = 0; |
6420 v80 = v76; | 6420 v80 = v76; |
6421 if ( (signed int)v62.uNumVertices > 0 ) | 6421 if ( (signed int)v62.uNumVertices > 0 ) |
6422 { | 6422 { |
6423 v28 = (double)SLODWORD(v76); | 6423 v28 = (double)SLODWORD(v76); |
6424 LODWORD(v76) = (int)(char *)array_50AC10 + 28; | 6424 LODWORD(v76) = (int)(char *)array_50AC10.data() + 28; |
6425 v29 = (char *)&array_50AC10[0].vWorldViewProjX; | 6425 v29 = (char *)&array_50AC10[0].vWorldViewProjX; |
6426 v30 = (char *)&array_507D30[1].vWorldViewProjY; | 6426 v30 = (char *)&array_507D30[1].vWorldViewProjY; |
6427 v79 = array_50AC10; | 6427 v79 = array_50AC10.data(); |
6428 v81 = array_507D30; | 6428 v81 = array_507D30.data(); |
6429 v78 = v62.uNumVertices; | 6429 v78 = v62.uNumVertices; |
6430 do | 6430 do |
6431 { | 6431 { |
6432 v31 = v28 < *((float *)v30 - 12); | 6432 v31 = v28 < *((float *)v30 - 12); |
6433 v32 = v28 == *((float *)v30 - 12); | 6433 v32 = v28 == *((float *)v30 - 12); |
6544 LABEL_40: | 6544 LABEL_40: |
6545 v47 = 0; | 6545 v47 = 0; |
6546 if ( SLODWORD(v73) > 0 ) | 6546 if ( SLODWORD(v73) > 0 ) |
6547 { | 6547 { |
6548 v48 = (double)SLODWORD(v80); | 6548 v48 = (double)SLODWORD(v80); |
6549 v75 = array_507D30; | 6549 v75 = array_507D30.data(); |
6550 v49 = array_50AC10; | 6550 v49 = array_50AC10.data(); |
6551 HIDWORD(v69) = LODWORD(v73); | 6551 HIDWORD(v69) = LODWORD(v73); |
6552 do | 6552 do |
6553 { | 6553 { |
6554 if ( v48 >= v49->vWorldViewProjY ) | 6554 if ( v48 >= v49->vWorldViewProjY ) |
6555 { | 6555 { |
6567 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]); | 6567 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]); |
6568 *(float *)&v74 = 0.0; | 6568 *(float *)&v74 = 0.0; |
6569 if ( SLODWORD(v73) > 0 ) | 6569 if ( SLODWORD(v73) > 0 ) |
6570 { | 6570 { |
6571 v51 = (double)SLODWORD(v80); | 6571 v51 = (double)SLODWORD(v80); |
6572 v75 = array_507D30; | 6572 v75 = array_507D30.data(); |
6573 v52 = array_50AC10; | 6573 v52 = array_50AC10.data(); |
6574 v80 = v73; | 6574 v80 = v73; |
6575 do | 6575 do |
6576 { | 6576 { |
6577 if ( v51 <= v52->vWorldViewProjY ) | 6577 if ( v51 <= v52->vWorldViewProjY ) |
6578 { | 6578 { |
7912 v11 = &array_508690[v19]; | 7912 v11 = &array_508690[v19]; |
7913 v12 = &array_508690[v20]; | 7913 v12 = &array_508690[v20]; |
7914 v13 = &array_508690[v21]; | 7914 v13 = &array_508690[v21]; |
7915 if ( LODWORD(v29) != 3 ) | 7915 if ( LODWORD(v29) != 3 ) |
7916 { | 7916 { |
7917 v11 = array_508690; | 7917 v11 = array_508690.data(); |
7918 v13 = (RenderVertexSoft *)((char *)array_508690 + 16 * (3 * v1 - 3)); | 7918 v13 = (RenderVertexSoft *)((char *)array_508690.data() + 16 * (3 * v1 - 3)); |
7919 v12 = &array_508690[1]; | 7919 v12 = &array_508690[1]; |
7920 v28 = array_508690[1].vWorldPosition.x - array_508690[0].vWorldPosition.x; | 7920 v28 = array_508690[1].vWorldPosition.x - array_508690[0].vWorldPosition.x; |
7921 v27 = array_508690[1].vWorldPosition.y - array_508690[0].vWorldPosition.y; | 7921 v27 = array_508690[1].vWorldPosition.y - array_508690[0].vWorldPosition.y; |
7922 v29 = array_508690[1].vWorldPosition.z - array_508690[0].vWorldPosition.z; | 7922 v29 = array_508690[1].vWorldPosition.z - array_508690[0].vWorldPosition.z; |
7923 v26 = v13->vWorldPosition.x - array_508690[0].vWorldPosition.x; | 7923 v26 = v13->vWorldPosition.x - array_508690[0].vWorldPosition.x; |