Mercurial > might-and-magic-trilogy
comparison Outdoor.cpp @ 104:62bfa3ffe7db
2.11.12
author | Ritor1 |
---|---|
date | Fri, 02 Nov 2012 10:04:08 +0600 |
parents | 5159d2e6f559 |
children | e633cde38d64 |
comparison
equal
deleted
inserted
replaced
87:c0cf9393af64 | 104:62bfa3ffe7db |
---|---|
364 v11 = (unsigned __int8)aTiletableLoadU[v10 + 39]; | 364 v11 = (unsigned __int8)aTiletableLoadU[v10 + 39]; |
365 if ( v11 >= 1 && v11 <= 15 ) | 365 if ( v11 >= 1 && v11 <= 15 ) |
366 { | 366 { |
367 v12 = (unsigned __int8)aTiletableLoadU[v10 + 39]; | 367 v12 = (unsigned __int8)aTiletableLoadU[v10 + 39]; |
368 uDefaultTravelTime_ByFoot = (unsigned __int8)byte_4ECA93[v10]; | 368 uDefaultTravelTime_ByFoot = (unsigned __int8)byte_4ECA93[v10]; |
369 sprintfex(pOut, "out%02d.odm", v12); | 369 sprintf(pOut, "out%02d.odm", v12); |
370 uLevel_StartingPointType = (unsigned __int8)byte_4ECACF[v10]; | 370 uLevel_StartingPointType = (unsigned __int8)byte_4ECACF[v10]; |
371 return 1; | 371 return 1; |
372 } | 372 } |
373 return 0; | 373 return 0; |
374 } | 374 } |
713 v2 = v1->pTilemap; | 713 v2 = v1->pTilemap; |
714 v1->pHeightmap = 0; | 714 v1->pHeightmap = 0; |
715 pAllocator->FreeChunk(v2); | 715 pAllocator->FreeChunk(v2); |
716 v3 = v1->pAttributemap; | 716 v3 = v1->pAttributemap; |
717 v1->pTilemap = 0; | 717 v1->pTilemap = 0; |
718 pAllocator->FreeChunk(v3); | 718 if (v3) |
719 { | |
720 pAllocator->FreeChunk(v3); | |
721 v3 = nullptr; | |
722 } | |
723 //pAllocator->FreeChunk(v3);// | |
719 v4 = v1->ptr_C; | 724 v4 = v1->ptr_C; |
720 v1->pAttributemap = 0; | 725 v1->pAttributemap = 0; |
721 pAllocator->FreeChunk(v4); | 726 pAllocator->FreeChunk(v4); |
722 v1->ptr_C = 0; | 727 v1->ptr_C = 0; |
723 _47C7A9(); | 728 _47C7A9(); |
1334 pPaletteManager->field_267AD2 = 0x80u; | 1339 pPaletteManager->field_267AD2 = 0x80u; |
1335 goto LABEL_7; | 1340 goto LABEL_7; |
1336 } | 1341 } |
1337 LABEL_8: | 1342 LABEL_8: |
1338 _6807E0_num_decorations_6807B8 = 0; | 1343 _6807E0_num_decorations_6807B8 = 0; |
1339 sprintfex(FileName, "levels\\%s", pContainer); | 1344 sprintf(FileName, "levels\\%s", pContainer); |
1340 if ( GetFileAttributesA(FileName) != -1 ) | 1345 if ( GetFileAttributesA(FileName) != -1 ) |
1341 { | 1346 { |
1342 result = (bool)fopen(FileName, "rb"); | 1347 result = (bool)fopen(FileName, "rb"); |
1343 v7 = result; | 1348 v7 = result; |
1344 File = (ODMFace *)result; | 1349 File = (ODMFace *)result; |
1410 v5->pBModels[v12].pFaces = 0; | 1415 v5->pBModels[v12].pFaces = 0; |
1411 v5->pBModels[v12].pFacesOrdering = 0; | 1416 v5->pBModels[v12].pFacesOrdering = 0; |
1412 v5->pBModels[v12].pNodes = 0; | 1417 v5->pBModels[v12].pNodes = 0; |
1413 FileName[0] = 0; | 1418 FileName[0] = 0; |
1414 v108 = (int)&v5->pBModels[v12]; | 1419 v108 = (int)&v5->pBModels[v12]; |
1415 sprintfex(FileName, "%s", v108); | 1420 sprintf(FileName, "%s", v108); |
1416 v13 = v5->pBModels; | 1421 v13 = v5->pBModels; |
1417 v138 = 0; | 1422 v138 = 0; |
1418 v5->pBModels[v12].pVertices.pVertices = (Vec3_int_ *)pAllocator->AllocNamedChunk( | 1423 v5->pBModels[v12].pVertices.pVertices = (Vec3_int_ *)pAllocator->AllocNamedChunk( |
1419 v13[v12].pVertices.pVertices, | 1424 v13[v12].pVertices.pVertices, |
1420 12 * v13[v12].pVertices.uNumVertices, | 1425 12 * v13[v12].pVertices.uNumVertices, |
1725 v5->pBModels[v48].pFaces = 0; | 1730 v5->pBModels[v48].pFaces = 0; |
1726 v5->pBModels[v48].pFacesOrdering = 0; | 1731 v5->pBModels[v48].pFacesOrdering = 0; |
1727 v5->pBModels[v48].pNodes = 0; | 1732 v5->pBModels[v48].pNodes = 0; |
1728 FileName[0] = 0; | 1733 FileName[0] = 0; |
1729 v108 = (int)&v5->pBModels[v48]; | 1734 v108 = (int)&v5->pBModels[v48]; |
1730 sprintfex(FileName, "%s", v108); | 1735 sprintf(FileName, "%s", v108); |
1731 v49 = v5->pBModels; | 1736 v49 = v5->pBModels; |
1732 v138 = 0; | 1737 v138 = 0; |
1733 v50 = &v49[v48]; | 1738 v50 = &v49[v48]; |
1734 v108 = (int)FileName; | 1739 v108 = (int)FileName; |
1735 v107 = 12 * v50->pVertices.uNumVertices; | 1740 v107 = 12 * v50->pVertices.uNumVertices; |
1900 pGameLoadingUI_ProgressBar->Progress(); | 1905 pGameLoadingUI_ProgressBar->Progress(); |
1901 free((void *)HIDWORD(v142)); | 1906 free((void *)HIDWORD(v142)); |
1902 v108 = (int)".ddm"; | 1907 v108 = (int)".ddm"; |
1903 v73 = strlen(pContainer); | 1908 v73 = strlen(pContainer); |
1904 strcpy((char *)v141 + v73, (const char *)v108); | 1909 strcpy((char *)v141 + v73, (const char *)v108); |
1905 v151 = (int)pNew_LOD->FindContainer(pContainer, 1); | 1910 v151 = (int)pNew_LOD->FindContainer(pContainer, 1); // |
1906 fread(&header, 0x10u, 1u, (FILE *)v151); | 1911 fread(&header, 0x10u, 1u, (FILE *)v151); |
1907 Str2 = 0; | 1912 Str2 = 0; |
1908 if ( header.uVersion != 91969 | 1913 if ( header.uVersion != 91969 |
1909 || header.pMagic[0] != 'm' | 1914 || header.pMagic[0] != 'm' |
1910 || header.pMagic[1] != 'v' | 1915 || header.pMagic[1] != 'v' |
2171 { | 2176 { |
2172 if ( rand() % 100 >= 20 ) | 2177 if ( rand() % 100 >= 20 ) |
2173 v108 = dword_4EC268[rand() % dword_4EC2A8]; | 2178 v108 = dword_4EC268[rand() % dword_4EC2A8]; |
2174 else | 2179 else |
2175 v108 = dword_4EC28C[rand() % dword_4EC2AC]; | 2180 v108 = dword_4EC28C[rand() % dword_4EC2AC]; |
2176 sprintfex(v5->field_4F8, "plansky%d", v108); | 2181 sprintf(v5->field_4F8, "plansky%d", v108); |
2177 } | 2182 } |
2178 } | 2183 } |
2179 else | 2184 else |
2180 { | 2185 { |
2181 strcpy(v5->field_4F8, "plansky3"); | 2186 strcpy(v5->field_4F8, "plansky3"); |