comparison Chest.cpp @ 535:426682cf4a75

m
author Ritor1
date Sat, 02 Mar 2013 00:24:12 +0600
parents 0dbf780e247f
children 55d0794848d1
comparison
equal deleted inserted replaced
534:69ef7c749e18 535:426682cf4a75
77 float v41; // [sp+BCh] [bp-8h]@23 77 float v41; // [sp+BCh] [bp-8h]@23
78 int sRotY; // [sp+C0h] [bp-4h]@8 78 int sRotY; // [sp+C0h] [bp-4h]@8
79 79
80 //a4 = uChestID; 80 //a4 = uChestID;
81 assert(uChestID < 20); 81 assert(uChestID < 20);
82 auto chest = pChests + uChestID; 82 auto chest = &pChests[uChestID];
83 83
84 ++pIcons_LOD->uTexturePacksCount; 84 ++pIcons_LOD->uTexturePacksCount;
85 if (!pIcons_LOD->uNumPrevLoadedFiles) 85 if (!pIcons_LOD->uNumPrevLoadedFiles)
86 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 86 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
87 87
218 word_A750E0 = 5; 218 word_A750E0 = 5;
219 word_A750E2 = uActiveCharacter; 219 word_A750E2 = uActiveCharacter;
220 } 220 }
221 pIcons_LOD->_4114F2(); 221 pIcons_LOD->_4114F2();
222 dword_507CD8 = 0; 222 dword_507CD8 = 0;
223 return 0; 223 return false;
224 } 224 }
225 chest->SetInitialized(false);//*v1 &= 0xFEu; 225 chest->SetInitialized(false);//*v1 &= 0xFEu;
226 sRotY = 1; 226 sRotY = 1;
227 LABEL_12: 227 LABEL_12:
228 pAudioPlayer->StopChannels(-1, -1); 228 pAudioPlayer->StopChannels(-1, -1);
231 { 231 {
232 if ( !dword_507CD8 ) 232 if ( !dword_507CD8 )
233 pPlayers[uActiveCharacter]->PlaySound(SPEECH_4, 0); 233 pPlayers[uActiveCharacter]->PlaySound(SPEECH_4, 0);
234 } 234 }
235 dword_507CD8 = 0; 235 dword_507CD8 = 0;
236 v3 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Chest, a4, 0); 236 v3 = GUIWindow::Create(0, 0, 640, 480, WINDOW_Chest, uChestID, 0);
237 pGUIWindow_CurrentMenu = v3; 237 pGUIWindow_CurrentMenu = v3;
238 pChestWindow = v3; 238 pChestWindow = v3;
239 pBtn_ExitCancel = v3->CreateButton( 239 pBtn_ExitCancel = v3->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79],// Exit
240 0x1D7u, 240 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0);
241 0x1BDu,
242 0xA9u,
243 0x23u,
244 1,
245 0,
246 0x71u,
247 0,
248 0,
249 pGlobalTXT_LocalizationStrings[79],// Exit
250 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
251 0);
252 pChestWindow->CreateButton(7u, 8u, 460u, 343u, 1, 0, 0xCu, 0, 0, "", 0); 241 pChestWindow->CreateButton(7u, 8u, 460u, 343u, 1, 0, 0xCu, 0, 0, "", 0);
253 pCurrentScreen = SCREEN_CHEST; 242 pCurrentScreen = SCREEN_CHEST;
254 pEventTimer->Pause(); 243 pEventTimer->Pause();
255 return 1; 244 return true;
256 } 245 }
257 246
258 //----- (0042092D) -------------------------------------------------------- 247 //----- (0042092D) --------------------------------------------------------
259 void Chest::DrawChestUI(unsigned int uChestID) 248 void Chest::DrawChestUI(unsigned int uChestID)
260 { 249 {
671 { 660 {
672 v12 = pChests[v3].mm7__vector_pItems;//&pChests[v3].mm7__vector_pItems[0].uAttributes; 661 v12 = pChests[v3].mm7__vector_pItems;//&pChests[v3].mm7__vector_pItems[0].uAttributes;
673 do 662 do
674 { 663 {
675 v9 = v12->uItemID; 664 v9 = v12->uItemID;
676 if ( v9 ) 665 if ( v9 > 0 )
677 { 666 {
678 v6 = 0; 667 v6 = 0;
679 while ( !Chest::CanPlaceItemAt((unsigned __int8)Dst[v6], v9, v10) ) 668 while ( !Chest::CanPlaceItemAt((unsigned __int8)Dst[v6], v9, v10) )
680 { 669 {
681 ++v6; 670 ++v6;