# HG changeset patch # User yoctozepto # Date 1378214949 -7200 # Node ID 46f6fc6f72fd7b647ff85c981c0e425ceab02cd3 # Parent 965af46e879397dc4daafe7ad441c8997e1111bf Clean :-) diff -r 965af46e8793 -r 46f6fc6f72fd mm7_3.cpp --- a/mm7_3.cpp Tue Sep 03 15:09:07 2013 +0200 +++ b/mm7_3.cpp Tue Sep 03 15:29:09 2013 +0200 @@ -7190,40 +7190,25 @@ } //----- (0044882F) -------------------------------------------------------- -void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName) +void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName) { - signed int v3; // ebp@1 - char *v4; // esi@2 - unsigned __int16 v5; // ax@6 - unsigned int v6; // [sp+4h] [bp-8h]@1 - int v7; // [sp+8h] [bp-4h]@1 - - v3 = 0; - v7 = a2; - v6 = uCog; - if ( (signed int)uNumLevelDecorations > 0 ) - { - v4 = (char *)&pLevelDecorations[0].uFlags; - do + for (size_t i = 0; i < uNumLevelDecorations; i++) + { + if (pLevelDecorations[i].uCog == uCog) { - if ( *((_WORD *)v4 + 9) == v6 ) + if (pFileName && strcmp(pFileName, "0")) { - if ( pFileName && _stricmp(pFileName, "0") ) - { - v5 = pDecorationList->GetDecorIdByName(pFileName); - *((_WORD *)v4 - 1) = v5; - pDecorationList->InitializeDecorationSprite((signed __int16)v5); - } - if ( v7 ) - *v4 &= 0xDFu; - else - *v4 |= 0x20u; - pParty->uFlags |= 2u; + pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pFileName); + pDecorationList->InitializeDecorationSprite(pLevelDecorations[i].uDecorationDescID); } - ++v3; - v4 += 32; + + if (bHide) + pLevelDecorations[i].uFlags &= ~LEVEL_DECORATION_INVISIBLE; + else + pLevelDecorations[i].uFlags |= LEVEL_DECORATION_INVISIBLE; + + pParty->uFlags |= 2u; } - while ( v3 < (signed int)uNumLevelDecorations ); } } diff -r 965af46e8793 -r 46f6fc6f72fd mm7_data.h --- a/mm7_data.h Tue Sep 03 15:09:07 2013 +0200 +++ b/mm7_data.h Tue Sep 03 15:29:09 2013 +0200 @@ -1360,7 +1360,7 @@ int NPC_EventProcessor(int npc_event_id, int entry_line = 0); void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3); void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename); -void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName); // idb +void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName); // idb void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on); void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle); void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide); // idb