Mercurial > mm7
comparison 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 |
comparison
equal
deleted
inserted
replaced
1196:44f37efc159c | 1202:0dbf6c4dd029 |
---|---|
49 IndoorLocation *pIndoor = new IndoorLocation; | 49 IndoorLocation *pIndoor = new IndoorLocation; |
50 BLVRenderParams *pBLVRenderParams = new BLVRenderParams; | 50 BLVRenderParams *pBLVRenderParams = new BLVRenderParams; |
51 | 51 |
52 struct DecorationList *pDecorationList; | 52 struct DecorationList *pDecorationList; |
53 | 53 |
54 LevelDecoration pLevelDecorations[3000]; | 54 std::array<LevelDecoration, 3000> pLevelDecorations; |
55 size_t uNumLevelDecorations; | 55 size_t uNumLevelDecorations; |
56 LevelDecoration* activeLevelDecoration; | 56 LevelDecoration* activeLevelDecoration; |
57 | 57 |
58 LEVEL_TYPE uCurrentlyLoadedLevelType = LEVEL_null; | 58 LEVEL_TYPE uCurrentlyLoadedLevelType = LEVEL_null; |
59 | 59 |
61 stru337 stru_F81018; | 61 stru337 stru_F81018; |
62 stru167_wrap array_5118E8; | 62 stru167_wrap array_5118E8; |
63 BspRenderer_stru2 stru_F8A590; | 63 BspRenderer_stru2 stru_F8A590; |
64 BspRenderer *pBspRenderer = new BspRenderer; // idb | 64 BspRenderer *pBspRenderer = new BspRenderer; // idb |
65 stru141 stru_721530; | 65 stru141 stru_721530; |
66 stru352 stru_F83B80[480]; | 66 std::array<stru352, 480> stru_F83B80; |
67 | 67 |
68 | 68 |
69 | 69 |
70 unsigned __int16 pDoorSoundIDsByLocationID[78] = | 70 unsigned __int16 pDoorSoundIDsByLocationID[78] = |
71 { | 71 { |
2682 | 2682 |
2683 pGameLoadingUI_ProgressBar->Progress(); | 2683 pGameLoadingUI_ProgressBar->Progress(); |
2684 pGameLoadingUI_ProgressBar->Progress(); | 2684 pGameLoadingUI_ProgressBar->Progress(); |
2685 | 2685 |
2686 memcpy(&uNumLevelDecorations, pData, 4); | 2686 memcpy(&uNumLevelDecorations, pData, 4); |
2687 memcpy(pLevelDecorations, pData + 4, uNumLevelDecorations * sizeof(LevelDecoration)); | 2687 memcpy(pLevelDecorations.data(), pData + 4, uNumLevelDecorations * sizeof(LevelDecoration)); |
2688 pData += 4 + uNumLevelDecorations * sizeof(LevelDecoration); | 2688 pData += 4 + uNumLevelDecorations * sizeof(LevelDecoration); |
2689 | 2689 |
2690 for (uint i = 0; i < uNumLevelDecorations; ++i) | 2690 for (uint i = 0; i < uNumLevelDecorations; ++i) |
2691 { | 2691 { |
2692 pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pData); | 2692 pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pData); |
2877 } | 2877 } |
2878 | 2878 |
2879 pGameLoadingUI_ProgressBar->Progress(); | 2879 pGameLoadingUI_ProgressBar->Progress(); |
2880 | 2880 |
2881 memcpy(&uNumActors, pData, 4); | 2881 memcpy(&uNumActors, pData, 4); |
2882 memcpy(pActors, pData + 4, uNumActors * sizeof(Actor)); | 2882 memcpy(pActors.data(), pData + 4, uNumActors * sizeof(Actor)); |
2883 pData += 4 + uNumActors * sizeof(Actor); | 2883 pData += 4 + uNumActors * sizeof(Actor); |
2884 | 2884 |
2885 pGameLoadingUI_ProgressBar->Progress(); | 2885 pGameLoadingUI_ProgressBar->Progress(); |
2886 pGameLoadingUI_ProgressBar->Progress(); | 2886 pGameLoadingUI_ProgressBar->Progress(); |
2887 | 2887 |
2910 } | 2910 } |
2911 | 2911 |
2912 pGameLoadingUI_ProgressBar->Progress(); | 2912 pGameLoadingUI_ProgressBar->Progress(); |
2913 | 2913 |
2914 memcpy(&uNumChests, pData, 4); | 2914 memcpy(&uNumChests, pData, 4); |
2915 memcpy(pChests, pData + 4, uNumChests * sizeof(Chest)); | 2915 memcpy(pChests.data(), pData + 4, uNumChests * sizeof(Chest)); |
2916 pData += 4 + uNumChests * sizeof(Chest); | 2916 pData += 4 + uNumChests * sizeof(Chest); |
2917 | 2917 |
2918 pGameLoadingUI_ProgressBar->Progress(); | 2918 pGameLoadingUI_ProgressBar->Progress(); |
2919 pGameLoadingUI_ProgressBar->Progress(); | 2919 pGameLoadingUI_ProgressBar->Progress(); |
2920 | 2920 |
4482 | 4482 |
4483 pGameLoadingUI_ProgressBar->Progress(); | 4483 pGameLoadingUI_ProgressBar->Progress(); |
4484 | 4484 |
4485 for (uint i = 0; i < uNumLevelDecorations; ++i) | 4485 for (uint i = 0; i < uNumLevelDecorations; ++i) |
4486 { | 4486 { |
4487 auto pDecortaion = pLevelDecorations + i; | 4487 auto pDecortaion = &pLevelDecorations[i]; |
4488 | 4488 |
4489 pDecorationList->InitializeDecorationSprite(pDecortaion->uDecorationDescID); | 4489 pDecorationList->InitializeDecorationSprite(pDecortaion->uDecorationDescID); |
4490 | 4490 |
4491 v15 = pDecorationList->pDecorations[pDecortaion->uDecorationDescID].uSoundID; | 4491 v15 = pDecorationList->pDecorations[pDecortaion->uDecorationDescID].uSoundID; |
4492 if (v15 && _6807E0_num_decorations_with_sounds_6807B8 < 9) | 4492 if (v15 && _6807E0_num_decorations_with_sounds_6807B8 < 9) |
4561 } | 4561 } |
4562 | 4562 |
4563 for (uint i = 0; i < uNumActors; ++i) | 4563 for (uint i = 0; i < uNumActors; ++i) |
4564 //if ( (signed int)uNumActors > (signed int)v13 ) | 4564 //if ( (signed int)uNumActors > (signed int)v13 ) |
4565 { | 4565 { |
4566 Actor *pActor = pActors + i; | 4566 Actor *pActor = &pActors[i]; |
4567 //v26 = (char *)&pActors[0].uAttributes; | 4567 //v26 = (char *)&pActors[0].uAttributes; |
4568 //do | 4568 //do |
4569 //{ | 4569 //{ |
4570 //v27 = *(int *)v26; | 4570 //v27 = *(int *)v26; |
4571 if (pActor->uAttributes & 0x100000) | 4571 if (pActor->uAttributes & 0x100000) |