annotate Engine/Objects/Chest.h @ 2518:3a1b56ab8749

d3d11 accepts RGBTexture
author a.parshin
date Thu, 09 Oct 2014 00:06:47 +0300
parents 82d5d92a097c
children fb42e2662c38
rev   line source
2497
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
1 #pragma once
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
2
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
3
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
4
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
5
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
6 /* 348 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
7 enum CHEST_FLAGS
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
8 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
9 CHEST_TRAPPED = 0x1,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
10 CHEST_ITEMS_PLACED = 0x2,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
11 CHEST_OPENED = 0x4,
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
12 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
13
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
14
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
15
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
16 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
17 struct ChestDesc
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
18 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
19 char pName[32];
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
20 char uWidth;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
21 char uHeight;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
22 __int16 uTextureID;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
23 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
24 #pragma pack(pop)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
25
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
26
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
27
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
28 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
29 struct ChestList
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
30 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
31 inline ChestList(): //----- (00458438)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
32 uNumChests(0), pChests(nullptr)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
33 {}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
34
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
35 void ToFile();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
36 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
37 int FromFileTxt(const char *Args);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
38
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
39
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
40 unsigned int uNumChests;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
41 struct ChestDesc *pChests;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
42 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
43 #pragma pack(pop)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
44
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
45
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
46
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
47 /* 65 */
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
48 #pragma pack(push, 1)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
49 struct Chest //0x14cc
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
50 {
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
51 inline bool Initialized() const {return (uFlags & CHEST_ITEMS_PLACED) != 0;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
52 inline void SetInitialized(bool b) {if (b) uFlags |= CHEST_ITEMS_PLACED; else uFlags &= ~CHEST_ITEMS_PLACED;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
53 inline bool Trapped() const {return (uFlags & CHEST_TRAPPED) != 0;}
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
54
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
55 static bool CanPlaceItemAt(signed int a1, int a2, signed int uChestID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
56 static int CountChestItems(signed int uChestID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
57 static int PutItemInChest(int a1, ItemGen *a2, signed int uChestID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
58 static void PlaceItemAt(unsigned int put_cell_pos, unsigned int uItemIdx, signed int uChestID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
59 static void PlaceItems(signed int uChestID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
60 static bool Open(signed int uChestID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
61 static void DrawChestUI(signed int uChestID);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
62 static void ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
63 static void ChestUI_WritePointedObjectStatusString();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
64 static void OnChestLeftClick();
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
65
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
66 unsigned __int16 uChestBitmapID; //0
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
67 unsigned __int16 uFlags; //2
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
68 struct ItemGen igChestItems[140]; //4
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
69 signed __int16 pInventoryIndices[140]; //0x13b4
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
70 };
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
71 #pragma pack(pop)
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
72
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
73 void __fastcall sub_420B13(int a1, int a2);
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
74
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
75
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
76 extern size_t uNumChests; // idb
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
77 extern struct ChestList *pChestList;
82d5d92a097c for MVS2012
Ritor1
parents:
diff changeset
78 extern std::array<Chest, 20> pChests;