Mercurial > might-and-magic-trilogy
comparison Indoor.cpp @ 56:1f161a887c69
Слияние
author | Ritor1 |
---|---|
date | Thu, 25 Oct 2012 09:02:49 +0600 |
parents | fd2fd234a66c |
children | 41cbaabde2cb |
comparison
equal
deleted
inserted
replaced
55:663d5bf032d9 | 56:1f161a887c69 |
---|---|
1731 pAllocator->FreeChunk(v1->pFaceExtras); | 1731 pAllocator->FreeChunk(v1->pFaceExtras); |
1732 pAllocator->FreeChunk(v1->pSectors); | 1732 pAllocator->FreeChunk(v1->pSectors); |
1733 pAllocator->FreeChunk(v1->pLights); | 1733 pAllocator->FreeChunk(v1->pLights); |
1734 pAllocator->FreeChunk(v1->pDoors); | 1734 pAllocator->FreeChunk(v1->pDoors); |
1735 pAllocator->FreeChunk(v1->pNodes); | 1735 pAllocator->FreeChunk(v1->pNodes); |
1736 pAllocator->FreeChunk(v1->pMapVertices); | 1736 pAllocator->FreeChunk(v1->pMapOutlines); |
1737 v1->pVertices = 0; | 1737 v1->pVertices = 0; |
1738 v1->pFaces = 0; | 1738 v1->pFaces = 0; |
1739 v1->pFaceExtras = 0; | 1739 v1->pFaceExtras = 0; |
1740 v1->pSectors = 0; | 1740 v1->pSectors = 0; |
1741 v1->pLights = 0; | 1741 v1->pLights = 0; |
1742 v1->pDoors = 0; | 1742 v1->pDoors = 0; |
1743 v1->pNodes = 0; | 1743 v1->pNodes = 0; |
1744 v1->pMapVertices = 0; | 1744 v1->pMapOutlines = 0; |
1745 v1->bLoaded = 0; | 1745 v1->bLoaded = 0; |
1746 } | 1746 } |
1747 | 1747 |
1748 //----- (00498C45) -------------------------------------------------------- | 1748 //----- (00498C45) -------------------------------------------------------- |
1749 int IndoorLocation::Alloc() | 1749 int IndoorLocation::Alloc() |
1785 v1->pLights = (BLVLightMM7 *)v10; | 1785 v1->pLights = (BLVLightMM7 *)v10; |
1786 v12 = pAllocator->AllocNamedChunk(v11, 0x3E80u, "L.D"); | 1786 v12 = pAllocator->AllocNamedChunk(v11, 0x3E80u, "L.D"); |
1787 v13 = v1->pNodes; | 1787 v13 = v1->pNodes; |
1788 v1->pDoors = (BLVDoor *)v12; | 1788 v1->pDoors = (BLVDoor *)v12; |
1789 v14 = pAllocator->AllocNamedChunk(v13, 0x9C40u, "L.BSP"); | 1789 v14 = pAllocator->AllocNamedChunk(v13, 0x9C40u, "L.BSP"); |
1790 v15 = v1->pMapVertices; | 1790 v15 = v1->pMapOutlines; |
1791 v1->pNodes = (BSPNode *)v14; | 1791 v1->pNodes = (BSPNode *)v14; |
1792 v16 = pAllocator->AllocNamedChunk(v15, 0x14824u, "L.Map"); | 1792 v16 = pAllocator->AllocNamedChunk(v15, 0x14824u, "L.Map"); |
1793 v17 = v1->pVertices; | 1793 v17 = v1->pVertices; |
1794 v1->pMapVertices = (BLVMapVertices *)v16; | 1794 v1->pMapOutlines = (BLVMapOutlines *)v16; |
1795 if ( v17 && v1->pFaces && v1->pFaceExtras && v1->pSectors && v1->pLights && v1->pDoors && v1->pNodes && v16 ) | 1795 if ( v17 && v1->pFaces && v1->pFaceExtras && v1->pSectors && v1->pLights && v1->pDoors && v1->pNodes && v16 ) |
1796 { | 1796 { |
1797 memset(v17, 90000, 0); | 1797 memset(v17, 90000, 0); |
1798 memset(v1->pFaces, 960000, 0); | 1798 memset(v1->pFaces, 960000, 0); |
1799 memset(v1->pFaceExtras, 180000, 0); | 1799 memset(v1->pFaceExtras, 180000, 0); |
1800 memset(v1->pSectors, 59392, 0); | 1800 memset(v1->pSectors, 59392, 0); |
1801 memset(v1->pLights, 6400, 0); | 1801 memset(v1->pLights, 6400, 0); |
1802 memset(v1->pDoors, 16000, 0); | 1802 memset(v1->pDoors, 16000, 0); |
1803 memset(v1->pNodes, 40000, 0); | 1803 memset(v1->pNodes, 40000, 0); |
1804 memset(v1->pMapVertices, 84004, 0); | 1804 memset(v1->pMapOutlines, 84004, 0); |
1805 result = 1; | 1805 result = 1; |
1806 } | 1806 } |
1807 else | 1807 else |
1808 { | 1808 { |
1809 result = 0; | 1809 result = 0; |
2459 fseek(v7, v233, 0); | 2459 fseek(v7, v233, 0); |
2460 fread(&stru_5E4C90, 1u, 0xC8u, v7); | 2460 fread(&stru_5E4C90, 1u, 0xC8u, v7); |
2461 fseek(v7, v234, 0); | 2461 fseek(v7, v234, 0); |
2462 fread(&uLastVisitDay, 1u, 0x38u, v7); | 2462 fread(&uLastVisitDay, 1u, 0x38u, v7); |
2463 fseek(v7, v223, 0); | 2463 fseek(v7, v223, 0); |
2464 v80 = (void **)&pMapVertices; | 2464 v80 = (void **)&pMapOutlines; |
2465 fread(*v80, 4u, 1u, v7); | 2465 fread(*v80, 4u, 1u, v7); |
2466 fread((char *)*v80 + 4, 0xCu, *(int *)*v80, v7); | 2466 fread((char *)*v80 + 4, 0xCu, *(int *)*v80, v7); |
2467 fclose(v7); | 2467 fclose(v7); |
2468 goto LABEL_179; | 2468 goto LABEL_179; |
2469 } | 2469 } |
2548 assert(sizeof(DDM_DLV_Header) == 40); | 2548 assert(sizeof(DDM_DLV_Header) == 40); |
2549 assert(sizeof(Actor) == 836); | 2549 assert(sizeof(Actor) == 836); |
2550 assert(sizeof(LayingItem) == 112); | 2550 assert(sizeof(LayingItem) == 112); |
2551 assert(sizeof(Chest) == 5324); | 2551 assert(sizeof(Chest) == 5324); |
2552 assert(sizeof(stru123) == 0xC8); | 2552 assert(sizeof(stru123) == 0xC8); |
2553 assert(sizeof(BLVMapOutline) == 12); | |
2553 | 2554 |
2554 bLoaded = true; | 2555 bLoaded = true; |
2555 | 2556 |
2556 auto pData = (char *)pRawBLV; | 2557 auto pData = (char *)pRawBLV; |
2557 | 2558 |
2833 | 2834 |
2834 pGameLoadingUI_ProgressBar->Progress(); | 2835 pGameLoadingUI_ProgressBar->Progress(); |
2835 pGameLoadingUI_ProgressBar->Progress(); | 2836 pGameLoadingUI_ProgressBar->Progress(); |
2836 | 2837 |
2837 //v201 = (const char *)v148; | 2838 //v201 = (const char *)v148; |
2838 //v200 = (size_t)pMapVertices; | 2839 //v200 = (size_t)pMapOutlines; |
2839 memcpy(&pMapVertices->uNumVertices, pData, 4); | 2840 memcpy(&pMapOutlines->uNumOutlines, pData, 4); |
2840 memcpy(pMapVertices->pVertices, pData + 4, pMapVertices->uNumVertices * sizeof(Vec3_int_)); | 2841 memcpy(pMapOutlines->pOutlines, pData + 4, pMapOutlines->uNumOutlines * sizeof(BLVMapOutline)); |
2841 //v149 = pMapVertices; | 2842 //v149 = pMapOutlines; |
2842 //v199 = 12 * *v149; | 2843 //v199 = 12 * *v149; |
2843 //memcpy(v149 + 1, (const void *)(v148 + 4), v199); | 2844 //memcpy(v149 + 1, (const void *)(v148 + 4), v199); |
2844 free(pRawBLV); | 2845 free(pRawBLV); |
2845 pRawBLV = nullptr; | 2846 pRawBLV = nullptr; |
2846 | 2847 |
2957 pData += 875; | 2958 pData += 875; |
2958 | 2959 |
2959 if ( *(int *)pDest ) | 2960 if ( *(int *)pDest ) |
2960 memcpy(_visible_outlines, v203, 875); | 2961 memcpy(_visible_outlines, v203, 875); |
2961 | 2962 |
2962 for (uint i = 0; i < pMapVertices->uNumVertices; ++i) | 2963 for (uint i = 0; i < pMapOutlines->uNumOutlines; ++i) |
2963 { | 2964 { |
2964 auto pVertex = pMapVertices->pVertices + i; | 2965 auto pVertex = pMapOutlines->pOutlines + i; |
2965 if ((unsigned __int8)(1 << (7 - i % 8)) & _visible_outlines[i / 8]) | 2966 if ((unsigned __int8)(1 << (7 - i % 8)) & _visible_outlines[i / 8]) |
2966 pVertex->uFlags |= 1; | 2967 pVertex->uFlags |= 1; |
2967 } | 2968 } |
2968 | 2969 |
2969 | 2970 |