diff options
author | Bendegúz Nagy | 2016-08-26 22:41:19 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 5bb19fd2611dd28e6187b4d873de3f754a352b74 (patch) | |
tree | f00e91b6c763b686a3b66efb1af99d41dc4a3f2e /engines/dm/group.h | |
parent | f3d4b854b7544c1379414983fcc750d60dfe2151 (diff) | |
download | scummvm-rg350-5bb19fd2611dd28e6187b4d873de3f754a352b74.tar.gz scummvm-rg350-5bb19fd2611dd28e6187b4d873de3f754a352b74.tar.bz2 scummvm-rg350-5bb19fd2611dd28e6187b4d873de3f754a352b74.zip |
DM: Add GroupMan, Group, ActiveGroup, F0196_GROUP_InitializeActiveGroups
Diffstat (limited to 'engines/dm/group.h')
-rw-r--r-- | engines/dm/group.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/engines/dm/group.h b/engines/dm/group.h new file mode 100644 index 0000000000..9e1300ccde --- /dev/null +++ b/engines/dm/group.h @@ -0,0 +1,94 @@ +/* ScummVM - Graphic Adventure Engine +* +* ScummVM is the legal property of its developers, whose names +* are too numerous to list here. Please refer to the COPYRIGHT +* file distributed with this source distribution. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +*/ + +/* +* Based on the Reverse Engineering work of Christophe Fontanel, +* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/) +*/ + + +#ifndef DM_GROUP_H +#define DM_GROUP_H + +#include "dm.h" + +namespace DM { + +class ActiveGroup { +public: + int _groupThingIndex; + byte _directions; + byte _cells; + byte _lastMoveTime; + byte _delayFleeingFromTarget; + byte _targetMapX; + byte _targetMapY; + byte _priorMapX; + byte _priorMapY; + byte _homeMapX; + byte _homeMapY; + byte _aspect[4]; +}; // @ ACTIVE_GROUP + + +class Group { +public: + Thing _nextThing; + Thing _slot; + byte _type; + byte _cells; + uint16 _health[4]; +private: + uint16 _flags; +public: + explicit Group(uint16 *rawDat) : _nextThing(rawDat[0]), _slot(rawDat[1]), _type(rawDat[2]), + _cells(rawDat[3]), _flags(rawDat[8]) { + _health[0] = rawDat[4]; + _health[1] = rawDat[5]; + _health[2] = rawDat[6]; + _health[3] = rawDat[7]; + } + + byte &getActiveGroupIndex() { return _cells; } + + uint16 getBehaviour() { return _flags & 0xF; } + uint16 getCount() { return (_flags >> 5) & 0x3; } + direction getDir() { return (direction)((_flags >> 8) & 0x3); } + uint16 getDoNotDiscard() { return (_flags >> 10) & 0x1; } +}; // @ GROUP + + +class GroupMan { + DMEngine *_vm; +public: + uint16 _maxActiveGroupCount = 60; // @ G0376_ui_MaximumActiveGroupCount + ActiveGroup *_activeGroups; // @ G0375_ps_ActiveGroups + GroupMan(DMEngine *vm); + ~GroupMan(); + void initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups +}; + + + +} + +#endif |