annotate Chest.h @ 1019:32ec62bbaa2c

player use item part cleanup
author Gloval
date Tue, 21 May 2013 01:21:10 +0400
parents d6236f6a9882
children c45d51b3f4f4
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2 #include "Items.h"
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6
Ritor1
parents:
diff changeset
7 /* 348 */
Ritor1
parents:
diff changeset
8 enum CHEST_FLAGS
Ritor1
parents:
diff changeset
9 {
Ritor1
parents:
diff changeset
10 CHEST_TRAPPED = 0x1,
Ritor1
parents:
diff changeset
11 CHEST_ITEMS_PLACED = 0x2,
Ritor1
parents:
diff changeset
12 CHEST_OPENED = 0x4,
Ritor1
parents:
diff changeset
13 };
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15
Ritor1
parents:
diff changeset
16
Ritor1
parents:
diff changeset
17 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
18 struct ChestDesc
Ritor1
parents:
diff changeset
19 {
Ritor1
parents:
diff changeset
20 char pName[32];
Ritor1
parents:
diff changeset
21 char uWidth;
Ritor1
parents:
diff changeset
22 char uHeight;
Ritor1
parents:
diff changeset
23 __int16 uTextureID;
Ritor1
parents:
diff changeset
24 };
Ritor1
parents:
diff changeset
25 #pragma pack(pop)
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28
Ritor1
parents:
diff changeset
29 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
30 struct ChestList
Ritor1
parents:
diff changeset
31 {
Ritor1
parents:
diff changeset
32 inline ChestList(): //----- (00458438)
Ritor1
parents:
diff changeset
33 uNumChests(0), pChests(nullptr)
Ritor1
parents:
diff changeset
34 {}
Ritor1
parents:
diff changeset
35
Ritor1
parents:
diff changeset
36 void ToFile();
Ritor1
parents:
diff changeset
37 void FromFile(void *pSerialized);
Ritor1
parents:
diff changeset
38 int FromFileTxt(const char *Args);
Ritor1
parents:
diff changeset
39
Ritor1
parents:
diff changeset
40
Ritor1
parents:
diff changeset
41 unsigned int uNumChests;
Ritor1
parents:
diff changeset
42 struct ChestDesc *pChests;
Ritor1
parents:
diff changeset
43 };
Ritor1
parents:
diff changeset
44 #pragma pack(pop)
Ritor1
parents:
diff changeset
45
Ritor1
parents:
diff changeset
46
Ritor1
parents:
diff changeset
47
Ritor1
parents:
diff changeset
48 /* 65 */
Ritor1
parents:
diff changeset
49 #pragma pack(push, 1)
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
50 struct Chest //0x14cc
0
Ritor1
parents:
diff changeset
51 {
426
94546824edad Chests party fixed
Nomad
parents: 0
diff changeset
52 inline bool Initialized() const {return uFlags & CHEST_ITEMS_PLACED;}
94546824edad Chests party fixed
Nomad
parents: 0
diff changeset
53 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
54 inline bool Trapped() const {return uFlags & CHEST_TRAPPED;}
94546824edad Chests party fixed
Nomad
parents: 0
diff changeset
55
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
56 static bool CanPlaceItemAt(signed int a1, int a2, signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
57 static int CountChestItems(signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
58 static int PutItemInChest(int a1, ItemGen *a2, signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
59 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
60 static void PlaceItems(signed int uChestID);
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
61 static bool Open(signed int uChestID);
706
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
62 static void DrawChestUI(signed int uChestID);
d6236f6a9882 Rough function rearranging to new files
Gloval
parents: 544
diff changeset
63 static void ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle);
0
Ritor1
parents:
diff changeset
64
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
65 unsigned __int16 uChestBitmapID; //0
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
66 unsigned __int16 uFlags; //2
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
67 struct ItemGen igChestItems[140]; //4
528
b1598f110b07 Chest working
Gloval
parents: 526
diff changeset
68 signed __int16 pInventoryIndices[140]; //0x13b4
0
Ritor1
parents:
diff changeset
69 };
Ritor1
parents:
diff changeset
70 #pragma pack(pop)
Ritor1
parents:
diff changeset
71
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 426
diff changeset
72 void __fastcall sub_420B13(int a1, int a2);
0
Ritor1
parents:
diff changeset
73
Ritor1
parents:
diff changeset
74
Ritor1
parents:
diff changeset
75 extern size_t uNumChests; // idb
Ritor1
parents:
diff changeset
76 extern struct ChestList *pChestList;
Ritor1
parents:
diff changeset
77 extern Chest pChests[20];