Mercurial > mm7
comparison Chest.cpp @ 706:d6236f6a9882
Rough function rearranging to new files
author | Gloval |
---|---|
date | Tue, 19 Mar 2013 21:53:21 +0400 |
parents | ef4d646d738d |
children | c232f160e6f3 |
comparison
equal
deleted
inserted
replaced
705:e39702f35283 | 706:d6236f6a9882 |
---|---|
248 pEventTimer->Pause(); | 248 pEventTimer->Pause(); |
249 return 1; | 249 return 1; |
250 } | 250 } |
251 | 251 |
252 //----- (0042092D) -------------------------------------------------------- | 252 //----- (0042092D) -------------------------------------------------------- |
253 void Chest::DrawChestUI(unsigned int uChestID) | 253 void Chest::DrawChestUI(signed int uChestID) |
254 { | 254 { |
255 | 255 |
256 int chestBitmapId; // eax@1 | 256 int chestBitmapId; // eax@1 |
257 unsigned int v5; // eax@1 | 257 unsigned int v5; // eax@1 |
258 int chest_item_index; // ecx@3 | 258 int chest_item_index; // ecx@3 |
313 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); | 313 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); |
314 } | 314 } |
315 | 315 |
316 | 316 |
317 //----- (0041FE71) -------------------------------------------------------- | 317 //----- (0041FE71) -------------------------------------------------------- |
318 bool Chest::CanPlaceItemAt( signed int test_cell_position, int item_id, unsigned int uChestID ) | 318 bool Chest::CanPlaceItemAt( signed int test_cell_position, int item_id, signed int uChestID ) |
319 { | 319 { |
320 int v3; // eax@1 | 320 int v3; // eax@1 |
321 unsigned int item_texture_id; // eax@1 | 321 unsigned int item_texture_id; // eax@1 |
322 Texture *item_texture; // ecx@1 | 322 Texture *item_texture; // ecx@1 |
323 signed int v6; // eax@1 | 323 signed int v6; // eax@1 |
381 return false; | 381 return false; |
382 } | 382 } |
383 // 506128: using guessed type int areWeLoadingTexture; | 383 // 506128: using guessed type int areWeLoadingTexture; |
384 | 384 |
385 //----- (0041FF64) -------------------------------------------------------- | 385 //----- (0041FF64) -------------------------------------------------------- |
386 int Chest::CountChestItems(unsigned int uChestID) | 386 int Chest::CountChestItems(signed int uChestID) |
387 { | 387 { |
388 signed int item_count; // eax@1 | 388 signed int item_count; // eax@1 |
389 int max_items; // edx@1 | 389 int max_items; // edx@1 |
390 item_count = 0; | 390 item_count = 0; |
391 max_items = pChestWidthsByType[pChests[uChestID].uChestBitmapID] * pChestHeightsByType[pChests[uChestID].uChestBitmapID]; | 391 max_items = pChestWidthsByType[pChests[uChestID].uChestBitmapID] * pChestHeightsByType[pChests[uChestID].uChestBitmapID]; |
407 } | 407 } |
408 return item_count; | 408 return item_count; |
409 } | 409 } |
410 | 410 |
411 //----- (0041FFA2) -------------------------------------------------------- | 411 //----- (0041FFA2) -------------------------------------------------------- |
412 int Chest::PutItemInChest(int position, ItemGen *put_item, unsigned int uChestID) | 412 int Chest::PutItemInChest(int position, ItemGen *put_item, signed int uChestID) |
413 { | 413 { |
414 int v3; // eax@1 | 414 int v3; // eax@1 |
415 ItemGen *v4; // edi@1 | 415 ItemGen *v4; // edi@1 |
416 int v5; // esi@1 | 416 int v5; // esi@1 |
417 int result; // eax@11 | 417 int result; // eax@11 |
514 return result; | 514 return result; |
515 } | 515 } |
516 // 506128: using guessed type int areWeLoadingTexture; | 516 // 506128: using guessed type int areWeLoadingTexture; |
517 | 517 |
518 //----- (0042013E) -------------------------------------------------------- | 518 //----- (0042013E) -------------------------------------------------------- |
519 void Chest::PlaceItemAt( unsigned int put_cell_pos, unsigned int item_at_cell, unsigned int uChestID ) | 519 void Chest::PlaceItemAt( unsigned int put_cell_pos, unsigned int item_at_cell, signed int uChestID ) |
520 { | 520 { |
521 | 521 |
522 int uItemID; // edi@1 | 522 int uItemID; // edi@1 |
523 int v6; // edx@4 | 523 int v6; // edx@4 |
524 unsigned int v7; // eax@5 | 524 unsigned int v7; // eax@5 |
566 pChests[uChestID].pInventoryIndices[put_cell_pos] = item_at_cell + 1; | 566 pChests[uChestID].pInventoryIndices[put_cell_pos] = item_at_cell + 1; |
567 } | 567 } |
568 // 506128: using guessed type int areWeLoadingTexture; | 568 // 506128: using guessed type int areWeLoadingTexture; |
569 | 569 |
570 //----- (00420284) -------------------------------------------------------- | 570 //----- (00420284) -------------------------------------------------------- |
571 void Chest::PlaceItems( unsigned int uChestID ) | 571 void Chest::PlaceItems(signed int uChestID ) |
572 { | 572 { |
573 int uChestArea; // edi@1 | 573 int uChestArea; // edi@1 |
574 int random_chest_pos; // eax@2 | 574 int random_chest_pos; // eax@2 |
575 int test_position; // ebx@11 | 575 int test_position; // ebx@11 |
576 char chest_cells_map[144]; // [sp+Ch] [bp-A0h]@1 | 576 char chest_cells_map[144]; // [sp+Ch] [bp-A0h]@1 |
619 } | 619 } |
620 } | 620 } |
621 pChests[uChestID].SetInitialized(true); | 621 pChests[uChestID].SetInitialized(true); |
622 } | 622 } |
623 // 420284: using guessed type char Dst[144]; | 623 // 420284: using guessed type char Dst[144]; |
624 | |
625 //----- (00448A17) -------------------------------------------------------- | |
626 void Chest::ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle) | |
627 { | |
628 unsigned __int16 *pFlags; // eax@3 | |
629 | |
630 if ( uChestID >= 0 && uChestID <= 19 ) | |
631 { | |
632 pFlags = &pChests[uChestID].uFlags; | |
633 if ( bToggle ) | |
634 *pFlags |= uFlag; | |
635 else | |
636 *pFlags &= ~uFlag; | |
637 } | |
638 } | |
624 | 639 |
625 //----- (00458B03) -------------------------------------------------------- | 640 //----- (00458B03) -------------------------------------------------------- |
626 void ChestList::ToFile() | 641 void ChestList::ToFile() |
627 { | 642 { |
628 ChestList *v1; // esi@1 | 643 ChestList *v1; // esi@1 |