Mercurial > might-and-magic-trilogy
diff Outdoor.cpp @ 109:62772029b56d
Слияние
author | Ritor1 |
---|---|
date | Tue, 06 Nov 2012 10:07:35 +0600 |
parents | ccc0cf95706a 3b5267621a5b |
children | 05b2d9653abc d2ca891da89f |
line wrap: on
line diff
--- a/Outdoor.cpp Tue Nov 06 10:06:45 2012 +0600 +++ b/Outdoor.cpp Tue Nov 06 10:07:35 2012 +0600 @@ -1281,8 +1281,8 @@ int v108; // [sp+0h] [bp-B80h]@10 char Src[968]; // [sp+10h] [bp-B70h]@110 char Dst[968]; // [sp+3D8h] [bp-7A8h]@50 - /*char Str[256]; // [sp+7A0h] [bp-3E0h]@50 - char DstBuf; // [sp+8A0h] [bp-2E0h]@10 + char Str[256]; // [sp+7A0h] [bp-3E0h]@50 + /*char DstBuf; // [sp+8A0h] [bp-2E0h]@10 __int32 Offset; // [sp+8A4h] [bp-2DCh]@10 __int32 v114; // [sp+8B0h] [bp-2D0h]@10 __int32 v115; // [sp+8BCh] [bp-2C4h]@10 @@ -2666,11 +2666,9 @@ } //----- (0047F138) -------------------------------------------------------- -int OutdoorLocation::PrepareDecorations() +bool OutdoorLocation::PrepareDecorations() { signed int v1; // ebx@1 - signed int v2; // edi@3 - LevelDecoration *v3; // esi@4 __int16 v4; // ax@5 int v5; // eax@7 __int16 v6; // ax@14 @@ -2680,42 +2678,38 @@ v8 = 0; if ( !_strcmpi(pCurrentMapName, "out09.odm") ) v8 = 1; - v2 = 0; - if ( (signed int)uNumLevelDecorations > 0 ) + + for (uint i = 0; i < uNumLevelDecorations; ++i) { - v3 = pLevelDecorations; - do - { - pDecorationList->InitializeDecorationSprite(v3->uDecorationDescID); - v4 = pDecorationList->pDecorations[v3->uDecorationDescID].uSoundID; + auto decor = pLevelDecorations + i; + + pDecorationList->InitializeDecorationSprite(decor->uDecorationDescID); + v4 = pDecorationList->pDecorations[decor->uDecorationDescID].uSoundID; if ( v4 && _6807E0_num_decorations_with_sounds_6807B8 < 9 ) { pSoundList->_4A9A67(v4, 0); v5 = _6807E0_num_decorations_with_sounds_6807B8++; - _6807B8_level_decorations_ids[v5] = v2; + _6807B8_level_decorations_ids[v5] = i; } - if ( v8 && v3->uCog == 20 ) - LOBYTE(v3->field_2) |= 0x40u; - if ( !v3->field_16_event_id ) + if ( v8 && decor->uCog == 20 ) + LOBYTE(decor->field_2) |= 0x40u; + if ( !decor->field_16_event_id ) { - if ( v3->IsInteractive() ) + if ( decor->IsInteractive() ) { if ( v1 < 124 ) { - v6 = v1++ + 75; - v3->field_1C = v6; - if ( !stru_5E4C90.field_0[v1 + 74] ) - LOBYTE(v3->field_2) |= 0x20u; + v6 = v1 + 75; + decor->_idx_in_stru123 = v6; + if ( !stru_5E4C90._decor_events[v1++] ) + LOBYTE(decor->field_2) |= 0x20u; } } } - ++v2; - ++v3; - } - while ( v2 < (signed int)uNumLevelDecorations ); } + pGameLoadingUI_ProgressBar->Progress(); - return 1; + return true; } // 6807E0: using guessed type int _6807E0_num_decorations_6807B8;