Mercurial > mm7
comparison Indoor.cpp @ 711:a5e587c8e30e
some cleaning
author | Gloval |
---|---|
date | Thu, 21 Mar 2013 23:10:57 +0400 |
parents | 436ae1842e92 |
children | e7c86528a2b3 |
comparison
equal
deleted
inserted
replaced
709:af08fc9e29c8 | 711:a5e587c8e30e |
---|---|
1718 v1->pMapOutlines = 0; | 1718 v1->pMapOutlines = 0; |
1719 v1->bLoaded = 0; | 1719 v1->bLoaded = 0; |
1720 } | 1720 } |
1721 | 1721 |
1722 //----- (00498C45) -------------------------------------------------------- | 1722 //----- (00498C45) -------------------------------------------------------- |
1723 int IndoorLocation::Alloc() | 1723 bool IndoorLocation::Alloc() |
1724 { | 1724 { |
1725 IndoorLocation *v1; // esi@1 | 1725 pVertices = (Vec3_short_ *) pAllocator->AllocNamedChunk(pVertices, 15000*sizeof(Vec3_short_), "L.V");//0x15F90u |
1726 void *v2; // eax@1 | 1726 pFaces = (BLVFace *) pAllocator->AllocNamedChunk(pFaces, 10000*sizeof(BLVFace), "L.F");//0xEA600u |
1727 const void *v3; // ST3C_4@1 | 1727 pFaceExtras = (BLVFaceExtra *) pAllocator->AllocNamedChunk(pFaceExtras,5000*sizeof(BLVFaceExtra), "L.FX"); //0x2BF20u |
1728 void *v4; // eax@1 | 1728 pSectors = (BLVSector *) pAllocator->AllocNamedChunk(pSectors, 512*sizeof(BLVSector), "L.R");//0xE800u |
1729 const void *v5; // ST3C_4@1 | 1729 pLights = (BLVLightMM7 *) pAllocator->AllocNamedChunk(pLights, 400*sizeof(BLVLightMM7), "L.L");//0x1900u |
1730 void *v6; // eax@1 | 1730 pDoors = (BLVDoor *) pAllocator->AllocNamedChunk(pDoors, 200*sizeof(BLVDoor), "L.D");//0x3E80u |
1731 const void *v7; // ST3C_4@1 | 1731 pNodes = (BSPNode *) pAllocator->AllocNamedChunk(pNodes, 5000*sizeof(BSPNode), "L.BSP");//0x9C40u |
1732 void *v8; // eax@1 | 1732 pMapOutlines =(BLVMapOutlines *)pAllocator->AllocNamedChunk(pMapOutlines, sizeof(BLVMapOutlines), "L.Map");//0x14824u |
1733 const void *v9; // ST3C_4@1 | 1733 if (pVertices && pFaces && pFaceExtras && pSectors && pLights && pDoors && pNodes && pMapOutlines ) |
1734 void *v10; // eax@1 | 1734 { |
1735 const void *v11; // ST3C_4@1 | 1735 memset(pVertices, 0, 15000*sizeof(Vec3_short_)); |
1736 void *v12; // eax@1 | 1736 memset(pFaces, 0, 10000*sizeof(BLVFace)); |
1737 const void *v13; // ST3C_4@1 | 1737 memset(pFaceExtras,0, 5000*sizeof(BLVFaceExtra)); |
1738 void *v14; // eax@1 | 1738 memset(pSectors, 0, 512*sizeof(BLVSector)); |
1739 const void *v15; // ST3C_4@1 | 1739 memset(pLights, 0, 400*sizeof(BLVLightMM7)); |
1740 void *v16; // eax@1 | 1740 memset(pDoors, 0, 200*sizeof(BLVDoor)); |
1741 void *v17; // ecx@1 | 1741 memset(pNodes, 0, 5000*sizeof(BSPNode)); |
1742 signed int result; // eax@9 | 1742 memset(pMapOutlines,0, sizeof(BLVMapOutlines)); |
1743 | 1743 return true; |
1744 v1 = this; | |
1745 v2 = pAllocator->AllocNamedChunk(this->pVertices, 0x15F90u, "L.V"); | |
1746 v3 = v1->pFaces; | |
1747 v1->pVertices = (Vec3_short_ *)v2; | |
1748 v4 = pAllocator->AllocNamedChunk(v3, 0xEA600u, "L.F"); | |
1749 v5 = v1->pFaceExtras; | |
1750 v1->pFaces = (BLVFace *)v4; | |
1751 v6 = pAllocator->AllocNamedChunk(v5, 0x2BF20u, "L.FX"); | |
1752 v7 = v1->pSectors; | |
1753 v1->pFaceExtras = (BLVFaceExtra *)v6; | |
1754 v8 = pAllocator->AllocNamedChunk(v7, 0xE800u, "L.R"); | |
1755 v9 = v1->pLights; | |
1756 v1->pSectors = (BLVSector *)v8; | |
1757 v10 = pAllocator->AllocNamedChunk(v9, 0x1900u, "L.L"); | |
1758 v11 = v1->pDoors; | |
1759 v1->pLights = (BLVLightMM7 *)v10; | |
1760 v12 = pAllocator->AllocNamedChunk(v11, 0x3E80u, "L.D"); | |
1761 v13 = v1->pNodes; | |
1762 v1->pDoors = (BLVDoor *)v12; | |
1763 v14 = pAllocator->AllocNamedChunk(v13, 0x9C40u, "L.BSP"); | |
1764 v15 = v1->pMapOutlines; | |
1765 v1->pNodes = (BSPNode *)v14; | |
1766 v16 = pAllocator->AllocNamedChunk(v15, 0x14824u, "L.Map"); | |
1767 v17 = v1->pVertices; | |
1768 v1->pMapOutlines = (BLVMapOutlines *)v16; | |
1769 if ( v17 && v1->pFaces && v1->pFaceExtras && v1->pSectors && v1->pLights && v1->pDoors && v1->pNodes && v16 ) | |
1770 { | |
1771 memset(v17, 90000, 0); | |
1772 memset(v1->pFaces, 960000, 0); | |
1773 memset(v1->pFaceExtras, 180000, 0); | |
1774 memset(v1->pSectors, 59392, 0); | |
1775 memset(v1->pLights, 6400, 0); | |
1776 memset(v1->pDoors, 16000, 0); | |
1777 memset(v1->pNodes, 40000, 0); | |
1778 memset(v1->pMapOutlines, 84004, 0); | |
1779 result = 1; | |
1780 } | 1744 } |
1781 else | 1745 else |
1782 { | 1746 { |
1783 result = 0; | 1747 return false; |
1784 } | 1748 } |
1785 return result; | |
1786 } | 1749 } |
1787 | 1750 |
1788 | 1751 |
1789 | 1752 |
1790 //----- (00444810) -------------------------------------------------------- | 1753 //----- (00444810) -------------------------------------------------------- |
1800 } | 1763 } |
1801 | 1764 |
1802 | 1765 |
1803 | 1766 |
1804 //----- (004488F7) -------------------------------------------------------- | 1767 //----- (004488F7) -------------------------------------------------------- |
1805 void IndoorLocation::ToggleLight(unsigned int uLightID, unsigned int bToggle) | 1768 void IndoorLocation::ToggleLight(signed int sLightID, unsigned int bToggle) |
1806 { | 1769 { |
1807 char *v2; // eax@4 | 1770 char *v2; // eax@4 |
1808 | 1771 |
1809 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && (signed int)uLightID <= pIndoor->uNumLights - 1 && (uLightID & 0x80000000u) == 0 ) | 1772 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && (sLightID <= pIndoor->uNumLights - 1) && (sLightID >= 0) ) |
1810 { | 1773 { |
1811 v2 = (char *)&pIndoor->pLights[uLightID].uAtributes; | 1774 v2 = (char *)&pIndoor->pLights[sLightID].uAtributes; |
1812 if ( bToggle ) | 1775 if ( bToggle ) |
1813 *v2 &= 0xF7u; | 1776 *v2 &= 0xF7u; |
1814 else | 1777 else |
1815 *v2 |= 8u; | 1778 *v2 |= 8u; |
1816 pParty->uFlags |= 2u; | 1779 pParty->uFlags |= 2u; |