comparison Indoor.cpp @ 1231:182b910c528d

Слияние
author Ritor1
date Sun, 09 Jun 2013 10:18:51 +0600
parents 513a7893aa29 96a81634669e
children 8eb865b584db
comparison
equal deleted inserted replaced
1230:513a7893aa29 1231:182b910c528d
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 {
76 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 404, 304, 76 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 404, 304,
77 400, 300, 300, 404, 304, 400, 300, 300, 404, 304, 400, 300, 300 77 400, 300, 300, 404, 304, 400, 300, 300, 404, 304, 400, 300, 300
78 }; 78 };
79 79
80 80
81 const char *_4E6BDC_loc_names[11]= 81 std::array<const char *, 11> _4E6BDC_loc_names=
82 { 82 {
83 "mdt12.blv", 83 "mdt12.blv",
84 "d18.blv", 84 "d18.blv",
85 "mdt14.blv", 85 "mdt14.blv",
86 "d37.blv", 86 "d37.blv",
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);
2783 } 2783 }
2784 2784
2785 if (dword_6BE364_game_settings_1 & 0x2000 ) 2785 if (dword_6BE364_game_settings_1 & 0x2000 )
2786 _i = 29030400; 2786 _i = 29030400;
2787 bool _a = false; 2787 bool _a = false;
2788 if ( a3 - dlv.uLastRepawnDay >= _i && _stricmp(pCurrentMapName, "d29.dlv") ) 2788 if ( a3 - dlv.uLastRepawnDay >= _i && _stricmp(pCurrentMapName.data(), "d29.dlv") )
2789 _a = true; 2789 _a = true;
2790 2790
2791 //v154 = 875; 2791 //v154 = 875;
2792 if (_v244) 2792 if (_v244)
2793 { 2793 {
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
2888 memcpy(&uNumSpriteObjects, pData, 4); 2888 memcpy(&uNumSpriteObjects, pData, 4);
2889 memcpy(pSpriteObjects, pData + 4, uNumSpriteObjects * sizeof(SpriteObject)); 2889 memcpy(pSpriteObjects.data(), pData + 4, uNumSpriteObjects * sizeof(SpriteObject));
2890 pData += 4 + uNumSpriteObjects * sizeof(SpriteObject); 2890 pData += 4 + uNumSpriteObjects * sizeof(SpriteObject);
2891 2891
2892 pGameLoadingUI_ProgressBar->Progress(); 2892 pGameLoadingUI_ProgressBar->Progress();
2893 2893
2894 for (uint i = 0; i < uNumSpriteObjects; ++i) 2894 for (uint i = 0; i < uNumSpriteObjects; ++i)
2895 { 2895 {
2896 auto pItem = pSpriteObjects + i; 2896 auto pItem = &pSpriteObjects[i];
2897 2897
2898 if (pItem->stru_24.uItemID && !(pItem->uAttributes & 0x0100)) 2898 if (pItem->stru_24.uItemID && !(pItem->uAttributes & 0x0100))
2899 { 2899 {
2900 pItem->uType = pItemsTable->pItems[pItem->stru_24.uItemID - 1].uSpriteID; 2900 pItem->uType = pItemsTable->pItems[pItem->stru_24.uItemID - 1].uSpriteID;
2901 2901
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
4320 if ( Is_out15odm_underwater() ) 4320 if ( Is_out15odm_underwater() )
4321 { 4321 {
4322 bUnderwater = 1; 4322 bUnderwater = 1;
4323 pGame->uFlags2 |= 8u; 4323 pGame->uFlags2 |= 8u;
4324 } 4324 }
4325 if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d23.blv") ) 4325 if ( !_stricmp(pCurrentMapName.data(), "out15.odm") || !_stricmp(pCurrentMapName.data(), "d23.blv") )
4326 bNoNPCHiring = 1; 4326 bNoNPCHiring = 1;
4327 pPaletteManager->pPalette_tintColor[0] = 0; 4327 pPaletteManager->pPalette_tintColor[0] = 0;
4328 pPaletteManager->pPalette_tintColor[1] = 0; 4328 pPaletteManager->pPalette_tintColor[1] = 0;
4329 pPaletteManager->pPalette_tintColor[2] = 0; 4329 pPaletteManager->pPalette_tintColor[2] = 0;
4330 pPaletteManager->RecalculateAll(); 4330 pPaletteManager->RecalculateAll();
4331 if ( qword_A750D8 ) 4331 if ( qword_A750D8 )
4332 qword_A750D8 = 0i64; 4332 qword_A750D8 = 0i64;
4333 v2 = pMapStats->GetMapInfo(pCurrentMapName); 4333 v2 = pMapStats->GetMapInfo(pCurrentMapName.data());
4334 v39 = v2; 4334 v39 = v2;
4335 if ( v2 ) 4335 if ( v2 )
4336 { 4336 {
4337 v3 = &pMapStats->pInfos[v2]; 4337 v3 = &pMapStats->pInfos[v2];
4338 v1 = v3->uRespawnIntervalDays; 4338 v1 = v3->uRespawnIntervalDays;
4347 ptr_6A0D08 = 0; 4347 ptr_6A0D08 = 0;
4348 _6A0D0C_txt_lod_loading = 0; 4348 _6A0D0C_txt_lod_loading = 0;
4349 TryLoadLevelFromLOD(); 4349 TryLoadLevelFromLOD();
4350 pStationaryLightsStack->uNumLightsActive = 0; 4350 pStationaryLightsStack->uNumLightsActive = 0;
4351 v4 = pIndoor->Load( 4351 v4 = pIndoor->Load(
4352 pCurrentMapName, 4352 pCurrentMapName.data(),
4353 (unsigned int)(signed __int64)((double)pParty->uTimePlayed * 0.234375) / 60 / 60 / 24 + 1, 4353 (unsigned int)(signed __int64)((double)pParty->uTimePlayed * 0.234375) / 60 / 60 / 24 + 1,
4354 v1, 4354 v1,
4355 (char *)&pDest) 4355 (char *)&pDest)
4356 - 1; 4356 - 1;
4357 if ( !v4 ) 4357 if ( !v4 )
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)
4544 4544
4545 pGameLoadingUI_ProgressBar->Progress(); 4545 pGameLoadingUI_ProgressBar->Progress();
4546 4546
4547 for (uint i = 0; i < uNumSpriteObjects; ++i) 4547 for (uint i = 0; i < uNumSpriteObjects; ++i)
4548 { 4548 {
4549 auto p = pSpriteObjects + i; 4549 auto p = &pSpriteObjects[i];
4550 if (p->uObjectDescID) 4550 if (p->uObjectDescID)
4551 { 4551 {
4552 auto uItemID = p->stru_24.uItemID; 4552 auto uItemID = p->stru_24.uItemID;
4553 if (uItemID) 4553 if (uItemID)
4554 { 4554 {
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)