annotate Chest.h @ 2461:ff7f4995aa25

function MakeScreenshot()
author Ritor1
date Tue, 05 Aug 2014 17:00:35 +0600
parents 5d263539bbec
children
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6 /* 348 */
Ritor1
parents:
diff changeset
7 enum CHEST_FLAGS
Ritor1
parents:
diff changeset
8 {
Ritor1
parents:
diff changeset
9 CHEST_TRAPPED = 0x1,
Ritor1
parents:
diff changeset
10 CHEST_ITEMS_PLACED = 0x2,
Ritor1
parents:
diff changeset
11 CHEST_OPENED = 0x4,
Ritor1
parents:
diff changeset
12 };
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15
Ritor1
parents:
diff changeset
16 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
17 struct ChestDesc
Ritor1
parents:
diff changeset
18 {
Ritor1
parents:
diff changeset
19 char pName[32];
Ritor1
parents:
diff changeset
20 char uWidth;
Ritor1
parents:
diff changeset
21 char uHeight;
Ritor1
parents:
diff changeset
22 __int16 uTextureID;
Ritor1
parents:
diff changeset
23 };
Ritor1
parents:
diff changeset
24 #pragma pack(pop)
Ritor1
parents:
diff changeset
25
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
29 struct ChestList
Ritor1
parents:
diff changeset
30 {
Ritor1
parents:
diff changeset
31 inline ChestList(): //----- (00458438)
Ritor1
parents:
diff changeset
32 uNumChests(0), pChests(nullptr)
Ritor1
parents:
diff changeset
33 {}
Ritor1
parents:
diff changeset
34
Ritor1
parents:
diff changeset
35 void ToFile();
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1202
diff changeset
36 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8);
0
Ritor1
parents:
diff changeset
37 int FromFileTxt(const char *Args);
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39
Ritor1
parents:
diff changeset
40 unsigned int uNumChests;
Ritor1
parents:
diff changeset
41 struct ChestDesc *pChests;
Ritor1
parents:
diff changeset
42 };
Ritor1
parents:
diff changeset
43 #pragma pack(pop)
Ritor1
parents:
diff changeset
44
Ritor1
parents:
diff changeset
45
Ritor1
parents:
diff changeset
46
Ritor1
parents:
diff changeset
47 /* 65 */
Ritor1
parents:
diff changeset
48 #pragma pack(push, 1)
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
49 struct Chest //0x14cc
0
Ritor1
parents:
diff changeset
50 {
1113
39eaa6b00141 something to bool cast (performance warning) mostly fixed
Grumpy7
parents: 1016
diff changeset
51 inline bool Initialized() const {return (uFlags & CHEST_ITEMS_PLACED) != 0;}
426
94546824edad Chests party fixed
Nomad
parents: 0
diff changeset
52 inline void SetInitialized(bool b) {if (b) uFlags |= CHEST_ITEMS_PLACED; else uFlags &= ~CHEST_ITEMS_PLACED;}
1113
39eaa6b00141 something to bool cast (performance warning) mostly fixed
Grumpy7
parents: 1016
diff changeset
53 inline bool Trapped() const {return (uFlags & CHEST_TRAPPED) != 0;}
426
94546824edad Chests party fixed
Nomad
parents: 0
diff changeset
54
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
55 static bool CanPlaceItemAt(signed int a1, int a2, signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
56 static int CountChestItems(signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
57 static int PutItemInChest(int a1, ItemGen *a2, signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
58 static void PlaceItemAt(unsigned int put_cell_pos, unsigned int uItemIdx, signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
59 static void PlaceItems(signed int uChestID);
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
60 static bool Open(signed int uChestID);
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
61 static void DrawChestUI(signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
62 static void ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle);
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 1477
diff changeset
63 static void ChestUI_WritePointedObjectStatusString();
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 1477
diff changeset
64 static void OnChestLeftClick();
0
Ritor1
parents:
diff changeset
65
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
66 unsigned __int16 uChestBitmapID; //0
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
67 unsigned __int16 uFlags; //2
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
68 struct ItemGen igChestItems[140]; //4
528
b1598f110b07 Chest working
Gloval
parents: 526
diff changeset
69 signed __int16 pInventoryIndices[140]; //0x13b4
0
Ritor1
parents:
diff changeset
70 };
Ritor1
parents:
diff changeset
71 #pragma pack(pop)
Ritor1
parents:
diff changeset
72
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
73 void __fastcall sub_420B13(int a1, int a2);
0
Ritor1
parents:
diff changeset
74
Ritor1
parents:
diff changeset
75
Ritor1
parents:
diff changeset
76 extern size_t uNumChests; // idb
Ritor1
parents:
diff changeset
77 extern struct ChestList *pChestList;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1113
diff changeset
78 extern std::array<Chest, 20> pChests;