Mercurial > mm7
diff Indoor.cpp @ 1202:0dbf6c4dd029
arrays to std::arrays phase 1
author | Grumpy7 |
---|---|
date | Sat, 08 Jun 2013 21:33:22 +0200 |
parents | 02e2a5c1ebc0 |
children | 8c02e6f74b29 |
line wrap: on
line diff
--- a/Indoor.cpp Sat Jun 08 19:34:33 2013 +0200 +++ b/Indoor.cpp Sat Jun 08 21:33:22 2013 +0200 @@ -51,7 +51,7 @@ struct DecorationList *pDecorationList; -LevelDecoration pLevelDecorations[3000]; +std::array<LevelDecoration, 3000> pLevelDecorations; size_t uNumLevelDecorations; LevelDecoration* activeLevelDecoration; @@ -63,7 +63,7 @@ BspRenderer_stru2 stru_F8A590; BspRenderer *pBspRenderer = new BspRenderer; // idb stru141 stru_721530; -stru352 stru_F83B80[480]; +std::array<stru352, 480> stru_F83B80; @@ -2684,7 +2684,7 @@ pGameLoadingUI_ProgressBar->Progress(); memcpy(&uNumLevelDecorations, pData, 4); - memcpy(pLevelDecorations, pData + 4, uNumLevelDecorations * sizeof(LevelDecoration)); + memcpy(pLevelDecorations.data(), pData + 4, uNumLevelDecorations * sizeof(LevelDecoration)); pData += 4 + uNumLevelDecorations * sizeof(LevelDecoration); for (uint i = 0; i < uNumLevelDecorations; ++i) @@ -2879,7 +2879,7 @@ pGameLoadingUI_ProgressBar->Progress(); memcpy(&uNumActors, pData, 4); - memcpy(pActors, pData + 4, uNumActors * sizeof(Actor)); + memcpy(pActors.data(), pData + 4, uNumActors * sizeof(Actor)); pData += 4 + uNumActors * sizeof(Actor); pGameLoadingUI_ProgressBar->Progress(); @@ -2912,7 +2912,7 @@ pGameLoadingUI_ProgressBar->Progress(); memcpy(&uNumChests, pData, 4); - memcpy(pChests, pData + 4, uNumChests * sizeof(Chest)); + memcpy(pChests.data(), pData + 4, uNumChests * sizeof(Chest)); pData += 4 + uNumChests * sizeof(Chest); pGameLoadingUI_ProgressBar->Progress(); @@ -4484,7 +4484,7 @@ for (uint i = 0; i < uNumLevelDecorations; ++i) { - auto pDecortaion = pLevelDecorations + i; + auto pDecortaion = &pLevelDecorations[i]; pDecorationList->InitializeDecorationSprite(pDecortaion->uDecorationDescID); @@ -4563,7 +4563,7 @@ for (uint i = 0; i < uNumActors; ++i) //if ( (signed int)uNumActors > (signed int)v13 ) { - Actor *pActor = pActors + i; + Actor *pActor = &pActors[i]; //v26 = (char *)&pActors[0].uAttributes; //do //{