ScummVM API documentation
objectman.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Based on the Reverse Engineering work of Christophe Fontanel,
24  * maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
25  */
26 
27 #ifndef DM_OBJECTMAN_H
28 #define DM_OBJECTMAN_H
29 
30 #include "dm/dm.h"
31 #include "dm/champion.h"
32 
33 namespace DM {
34 
35 #define kDMObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH
36 #define kDMObjectNameCount 199 // @ C199_OBJECT_NAME_COUNT
37 #define kDMObjectNamesGraphicIndice 556 // @ C556_GRAPHIC_OBJECT_NAMES
38 
39 class SlotBox {
40 public:
41  int16 _x;
42  int16 _y;
43  int16 _iconIndex;
44  SlotBox(int16 x, int16 y, int16 iconIndex): _x(x), _y(y), _iconIndex(iconIndex) {}
45  SlotBox(): _x(-1), _y(-1), _iconIndex(-1) {}
46 }; // @ SLOT_BOX
47 
48 class ObjectMan {
49  DMEngine *_vm;
50 
51 public:
52  explicit ObjectMan(DMEngine *vm);
53  ~ObjectMan();
54  void loadObjectNames(); // @ F0031_OBJECT_LoadNames
55 
56  SlotBox _slotBoxes[46]; // @ G0030_as_Graphic562_SlotBoxes;
57  char *_objectNames[kDMObjectNameCount]; // @ G0352_apc_ObjectNames
58  byte *_objectIconForMousePointer; // @ G0412_puc_Bitmap_ObjectIconForMousePointer
59 
60  IconIndice getObjectType(Thing thing); // @ F0032_OBJECT_GetType
61  IconIndice getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex
62  void extractIconFromBitmap(uint16 iconIndex, byte *destBitmap); // @ F0036_OBJECT_ExtractIconFromBitmap
63  void drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex); // @ F0038_OBJECT_DrawIconInSlotBox
64  void drawLeaderObjectName(Thing thing); // @ F0034_OBJECT_DrawLeaderHandObjectName
65  IconIndice getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox
66  void clearLeaderObjectName(); // @ F0035_OBJECT_ClearLeaderHandObjectName
67  void drawIconToScreen(int16 iconIndex, int16 posX, int16 posY); // @ F0037_OBJECT_DrawIconToScreen
68 
69  int16 _iconGraphicHeight[7]; // @ K0077_ai_IconGraphicHeight
70  int16 _iconGraphicFirstIndex[7]; // G0026_ai_Graphic562_IconGraphicFirstIconIndex
71 
72  void initConstants();
73 };
74 }
75 
76 #endif
Definition: dm.h:117
Definition: champion.h:35
Definition: objectman.h:39
Definition: dm.h:155
Definition: objectman.h:48