2004-04-12 21:40:49 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2005-01-01 16:20:17 +00:00
|
|
|
* Copyright (C) 2004-2005 The ScummVM project
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-05-01 13:04:31 +00:00
|
|
|
// Object map / Object click-area module header file
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
#ifndef SAGA_OBJECTMAP_H_
|
|
|
|
#define SAGA_OBJECTMAP_H_
|
|
|
|
|
2004-12-24 20:44:39 +00:00
|
|
|
#include "saga/stream.h"
|
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
namespace Saga {
|
|
|
|
|
2004-10-08 01:22:39 +00:00
|
|
|
|
2004-12-24 20:44:39 +00:00
|
|
|
class HitZone {
|
|
|
|
private:
|
|
|
|
struct ClickArea {
|
|
|
|
int pointsCount;
|
|
|
|
Point *points;
|
|
|
|
};
|
|
|
|
public:
|
|
|
|
|
|
|
|
HitZone(MemoryReadStreamEndian *readStream);
|
|
|
|
~HitZone();
|
|
|
|
|
|
|
|
int getSceneNumber() const {
|
|
|
|
return _nameNumber;
|
|
|
|
}
|
2005-01-15 23:46:43 +00:00
|
|
|
int getActorsEntrance() const {
|
|
|
|
return _scriptNumber;
|
|
|
|
}
|
|
|
|
int getScriptNumber() const {
|
2004-12-24 20:44:39 +00:00
|
|
|
return _scriptNumber;
|
|
|
|
}
|
2005-01-15 20:12:49 +00:00
|
|
|
int getRightButtonVerb() const {
|
|
|
|
return _rightButtonVerb;
|
|
|
|
}
|
2005-01-15 23:46:43 +00:00
|
|
|
int getFlags() const {
|
|
|
|
return _flags;
|
|
|
|
}
|
|
|
|
int getDirection() const {
|
|
|
|
return ((_flags >> 4) & 0xF);
|
|
|
|
}
|
2004-12-24 20:44:39 +00:00
|
|
|
void draw(SURFACE *ds, int color);
|
|
|
|
bool hitTest(const Point &testPoint);
|
|
|
|
private:
|
|
|
|
int _flags; // HitZoneFlags
|
|
|
|
int _clickAreasCount;
|
2005-01-15 20:12:49 +00:00
|
|
|
int _rightButtonVerb;
|
2004-12-24 20:44:39 +00:00
|
|
|
int _nameNumber;
|
|
|
|
int _scriptNumber;
|
2004-10-08 01:22:39 +00:00
|
|
|
|
2004-12-24 20:44:39 +00:00
|
|
|
ClickArea *_clickAreas;
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-12-24 20:44:39 +00:00
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
struct OBJECTMAP_ENTRY {
|
2004-10-05 02:16:26 +00:00
|
|
|
byte flags;
|
|
|
|
byte defaultVerb;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-07 23:02:19 +00:00
|
|
|
int objectNum;
|
|
|
|
int scriptNum;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-07 23:02:19 +00:00
|
|
|
int nClickareas;
|
2004-10-27 21:32:28 +00:00
|
|
|
CLICKAREA *clickareas;
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-08-02 15:44:18 +00:00
|
|
|
class ObjectMap{
|
|
|
|
public:
|
2004-10-07 23:02:19 +00:00
|
|
|
ObjectMap(SagaEngine *vm);
|
2004-08-02 15:44:18 +00:00
|
|
|
~ObjectMap(void);
|
|
|
|
int load(const byte *om_res, size_t om_res_len);
|
|
|
|
int freeMem(void);
|
|
|
|
int loadNames(const byte *onl_res, size_t onl_res_len);
|
|
|
|
int freeNames();
|
2004-10-05 02:16:26 +00:00
|
|
|
const char *getName(int object);
|
|
|
|
const uint16 getFlags(int object);
|
|
|
|
const int getEPNum(int object);
|
2004-10-27 21:32:28 +00:00
|
|
|
int draw(SURFACE *draw_surface, const Point& imousePt, int color, int color2);
|
2004-10-08 19:58:49 +00:00
|
|
|
int hitTest(const Point& imousePt);
|
2004-12-24 20:44:39 +00:00
|
|
|
void cmdInfo(void);
|
2004-10-07 23:02:19 +00:00
|
|
|
|
2004-08-02 15:44:18 +00:00
|
|
|
private:
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-07 23:02:19 +00:00
|
|
|
bool _objectsLoaded;
|
|
|
|
int _nObjects;
|
2004-10-27 21:32:28 +00:00
|
|
|
OBJECTMAP_ENTRY *_objectMaps;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-07 23:02:19 +00:00
|
|
|
bool _namesLoaded;
|
|
|
|
int _nNames;
|
2004-08-02 15:44:18 +00:00
|
|
|
const char **_names;
|
2004-10-07 23:02:19 +00:00
|
|
|
SagaEngine *_vm;
|
2004-08-02 15:44:18 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
} // End of namespace Saga
|
|
|
|
|
2004-05-01 13:04:31 +00:00
|
|
|
#endif
|