aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/objectmap.h
diff options
context:
space:
mode:
authorMax Horn2006-02-11 22:45:04 +0000
committerMax Horn2006-02-11 22:45:04 +0000
commit26ee630756ebdd7c96bccede0881a8c8b98e8f2b (patch)
tree26e378d5cf990a2b81c2c96e9e683a7f333b62e8 /engines/saga/objectmap.h
parent2a9a0d4211b1ea5723f1409d91cb95de8984429e (diff)
downloadscummvm-rg350-26ee630756ebdd7c96bccede0881a8c8b98e8f2b.tar.gz
scummvm-rg350-26ee630756ebdd7c96bccede0881a8c8b98e8f2b.tar.bz2
scummvm-rg350-26ee630756ebdd7c96bccede0881a8c8b98e8f2b.zip
Moved engines to the new engines/ directory
svn-id: r20582
Diffstat (limited to 'engines/saga/objectmap.h')
-rw-r--r--engines/saga/objectmap.h128
1 files changed, 128 insertions, 0 deletions
diff --git a/engines/saga/objectmap.h b/engines/saga/objectmap.h
new file mode 100644
index 0000000000..43356d3579
--- /dev/null
+++ b/engines/saga/objectmap.h
@@ -0,0 +1,128 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2004-2006 The ScummVM project
+ *
+ * The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
+ *
+ * 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+// Object map / Object click-area module header file
+
+#ifndef SAGA_OBJECTMAP_H_
+#define SAGA_OBJECTMAP_H_
+
+#include "saga/stream.h"
+
+namespace Saga {
+
+
+class HitZone {
+private:
+ struct ClickArea {
+ int pointsCount;
+ Point *points;
+ };
+
+public:
+ HitZone(MemoryReadStreamEndian *readStream, int index);
+ ~HitZone();
+
+ int getNameIndex() const {
+ return _nameIndex;
+ }
+ int getSceneNumber() const {
+ return _nameIndex;
+ }
+ int getActorsEntrance() const {
+ return _scriptNumber;
+ }
+ int getScriptNumber() const {
+ return _scriptNumber;
+ }
+ int getRightButtonVerb() const {
+ return _rightButtonVerb;
+ }
+ int getFlags() const {
+ return _flags;
+ }
+ void setFlag(HitZoneFlags flag) {
+ _flags |= flag;
+ }
+ void clearFlag(HitZoneFlags flag) {
+ _flags &= ~flag;
+ }
+ int getDirection() const {
+ return ((_flags >> 4) & 0xF);
+ }
+ uint16 getHitZoneId() const {
+ return objectIndexToId(kGameObjectHitZone, _index);
+ }
+ uint16 getStepZoneId() const {
+ return objectIndexToId(kGameObjectStepZone, _index);
+ }
+ bool getSpecialPoint(Point &specialPoint) const;
+ void draw(SagaEngine *vm, Surface *ds, int color);
+ bool hitTest(const Point &testPoint);
+
+private:
+ int _flags; // Saga::HitZoneFlags
+ int _clickAreasCount;
+ int _rightButtonVerb;
+ int _nameIndex;
+ int _scriptNumber;
+ int _index;
+
+ ClickArea *_clickAreas;
+};
+
+
+class ObjectMap {
+public:
+ ObjectMap(SagaEngine *vm) : _vm(vm) {
+ _hitZoneList = NULL;
+ _hitZoneListCount = 0;
+
+ }
+ ~ObjectMap(void) {
+ freeMem();
+ }
+ void load(const byte *resourcePointer, size_t resourceLength);
+ void freeMem(void);
+
+ void draw(Surface *drawSurface, const Point& testPoint, int color, int color2);
+ int hitTest(const Point& testPoint);
+ HitZone *getHitZone(int16 index) {
+ if ((index < 0) || (index >= _hitZoneListCount)) {
+ error("ObjectMap::getHitZone wrong index 0x%X", index);
+ }
+ return _hitZoneList[index];
+ }
+
+ void cmdInfo(void);
+
+private:
+ SagaEngine *_vm;
+
+ int _hitZoneListCount;
+ HitZone **_hitZoneList;
+};
+
+} // End of namespace Saga
+
+#endif