2014-03-06 02:50:12 +00:00
|
|
|
/* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MADS_HOTSPOTS_H
|
|
|
|
#define MADS_HOTSPOTS_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "mads/events.h"
|
2014-03-26 02:07:33 +00:00
|
|
|
#include "mads/player.h"
|
2014-03-06 02:50:12 +00:00
|
|
|
|
|
|
|
namespace MADS {
|
|
|
|
|
|
|
|
class MADSEngine;
|
|
|
|
|
|
|
|
class DynamicHotspot {
|
|
|
|
public:
|
|
|
|
bool _active;
|
|
|
|
int _seqIndex;
|
|
|
|
Common::Rect _bounds;
|
|
|
|
Common::Point _feetPos;
|
2014-03-26 02:07:33 +00:00
|
|
|
Facing _facing;
|
2014-03-06 02:50:12 +00:00
|
|
|
int _descId;
|
2014-04-30 01:53:54 +00:00
|
|
|
int _verbId;
|
2014-03-06 02:50:12 +00:00
|
|
|
int _articleNumber;
|
|
|
|
CursorType _cursor;
|
|
|
|
|
2014-05-02 02:36:36 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2014-03-06 02:50:12 +00:00
|
|
|
DynamicHotspot();
|
2014-05-02 02:36:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronize the data
|
|
|
|
*/
|
|
|
|
void synchronize(Common::Serializer &s);
|
2014-03-06 02:50:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DYNAMIC_HOTSPOTS_SIZE 8
|
|
|
|
|
|
|
|
class DynamicHotspots {
|
|
|
|
private:
|
|
|
|
MADSEngine *_vm;
|
|
|
|
Common::Array<DynamicHotspot> _entries;
|
|
|
|
int _count;
|
|
|
|
public:
|
|
|
|
bool _changed;
|
|
|
|
public:
|
|
|
|
DynamicHotspots(MADSEngine *vm);
|
|
|
|
|
2014-03-24 18:15:59 +00:00
|
|
|
Common::Array<MADS::DynamicHotspot>::size_type size() const { return _entries.size(); }
|
2014-03-06 02:50:12 +00:00
|
|
|
DynamicHotspot &operator[](uint idx) { return _entries[idx]; }
|
2014-04-30 01:53:54 +00:00
|
|
|
int add(int descId, int verbId, int seqIndex, const Common::Rect &bounds);
|
2014-04-08 08:36:12 +00:00
|
|
|
int setPosition(int index, const Common::Point &pos, Facing facing);
|
2014-03-06 02:50:12 +00:00
|
|
|
int setCursor(int index, CursorType cursor);
|
|
|
|
void remove(int index);
|
|
|
|
void clear();
|
|
|
|
void reset();
|
|
|
|
void refresh();
|
2014-05-02 02:36:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronize the data
|
|
|
|
*/
|
|
|
|
void synchronize(Common::Serializer &s);
|
2014-03-06 02:50:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class Hotspot {
|
|
|
|
public:
|
|
|
|
Common::Rect _bounds;
|
|
|
|
Common::Point _feetPos;
|
2014-03-26 02:07:33 +00:00
|
|
|
Facing _facing;
|
2014-03-06 02:50:12 +00:00
|
|
|
int _articleNumber;
|
2014-03-23 01:55:36 +00:00
|
|
|
bool _active;
|
2014-03-06 02:50:12 +00:00
|
|
|
CursorType _cursor;
|
|
|
|
int _vocabId;
|
|
|
|
int _verbId;
|
|
|
|
|
|
|
|
Hotspot();
|
2014-04-27 18:14:26 +00:00
|
|
|
Hotspot(Common::SeekableReadStream &f, bool isV2);
|
2014-03-06 02:50:12 +00:00
|
|
|
};
|
|
|
|
|
2014-03-15 21:38:44 +00:00
|
|
|
class Hotspots : public Common::Array<Hotspot> {
|
2014-03-23 01:55:36 +00:00
|
|
|
private:
|
|
|
|
MADSEngine *_vm;
|
2014-03-15 21:38:44 +00:00
|
|
|
public:
|
2014-03-23 01:55:36 +00:00
|
|
|
Hotspots(MADSEngine *vm) : _vm(vm) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the active state of a given hotspot
|
|
|
|
*/
|
|
|
|
void activate(int vocabId, bool active);
|
2014-03-15 21:38:44 +00:00
|
|
|
};
|
2014-03-06 02:50:12 +00:00
|
|
|
|
|
|
|
} // End of namespace MADS
|
|
|
|
|
|
|
|
#endif /* MADS_HOTSPOTS_H */
|