annotate Chest.h @ 1083:ddf53a2d0bf5

pointer cleaning
author zipi
date Sat, 25 May 2013 22:28:13 +0100
parents c45d51b3f4f4
children 39eaa6b00141
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();
Ritor1
parents:
diff changeset
36 void FromFile(void *pSerialized);
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 {
426
94546824edad Chests party fixed
Nomad
parents: 0
diff changeset
51 inline bool Initialized() const {return uFlags & CHEST_ITEMS_PLACED;}
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;}
94546824edad Chests party fixed
Nomad
parents: 0
diff changeset
53 inline bool Trapped() const {return uFlags & CHEST_TRAPPED;}
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);
0
Ritor1
parents:
diff changeset
63
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
64 unsigned __int16 uChestBitmapID; //0
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
65 unsigned __int16 uFlags; //2
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
66 struct ItemGen igChestItems[140]; //4
528
b1598f110b07 Chest working
Gloval
parents: 526
diff changeset
67 signed __int16 pInventoryIndices[140]; //0x13b4
0
Ritor1
parents:
diff changeset
68 };
Ritor1
parents:
diff changeset
69 #pragma pack(pop)
Ritor1
parents:
diff changeset
70
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
71 void __fastcall sub_420B13(int a1, int a2);
0
Ritor1
parents:
diff changeset
72
Ritor1
parents:
diff changeset
73
Ritor1
parents:
diff changeset
74 extern size_t uNumChests; // idb
Ritor1
parents:
diff changeset
75 extern struct ChestList *pChestList;
Ritor1
parents:
diff changeset
76 extern Chest pChests[20];