ScummVM API documentation
spot.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 * Additional copyright for this file:
8 * Copyright (C) 1995-1997 Presto Studios, Inc.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
25#ifndef PEGASUS_NEIGHBORHOOD_SPOT_H
26#define PEGASUS_NEIGHBORHOOD_SPOT_H
27
28#include "common/array.h"
29#include "common/endian.h"
30
31#include "pegasus/constants.h"
32
33namespace Common {
34 class SeekableReadStream;
35}
36
37namespace Pegasus {
38
39typedef byte SpotFlags;
40
41enum {
42 kSpotLoopsBit, // Loop or once only?
43 kSpotOnArrivalBit,
44 kSpotOnTurnBit,
45 kSpotOnDoorOpenBit
46};
47
48static const SpotFlags kNoSpotFlags = 0;
49static const SpotFlags kSpotLoopsMask = 1 << kSpotLoopsBit;
50static const SpotFlags kSpotOnArrivalMask = 1 << kSpotOnArrivalBit;
51static const SpotFlags kSpotOnTurnMask = 1 << kSpotOnTurnBit;
52static const SpotFlags kSpotOnDoorOpenMask = 1 << kSpotOnDoorOpenBit;
53
54static const SpotFlags kSpotTriggers = kSpotOnArrivalMask | kSpotOnTurnMask | kSpotOnDoorOpenMask;
55
56class SpotTable {
57public:
58 SpotTable() {}
59 ~SpotTable() {}
60
61 static uint32 getResTag() { return MKTAG('S', 'p', 'o', 't'); }
62
63 void loadFromStream(Common::SeekableReadStream *stream);
64 void clear();
65
66 struct Entry {
67 Entry() { clear(); }
68 bool isEmpty() { return movieStart == 0xffffffff; }
69 void clear() {
70 room = kNoRoomID;
71 direction = kNoDirection;
72 srcFlags = kNoSpotFlags;
73 altCode = kNoAlternateID;
74 movieStart = 0xffffffff;
75 movieEnd = 0xffffffff;
76 dstFlags = kNoSpotFlags;
77 }
78
79 RoomID room;
80 DirectionConstant direction;
81 SpotFlags srcFlags;
82 AlternateID altCode;
83 TimeValue movieStart;
84 TimeValue movieEnd;
85 SpotFlags dstFlags;
86 };
87
88 Entry findEntry(RoomID room, DirectionConstant direction, SpotFlags srcFlags, AlternateID altCode);
89
90private:
91 Common::Array<Entry> _entries;
92};
93
94} // End of namespace Pegasus
95
96#endif
Definition: stream.h:745
Definition: spot.h:56
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
Definition: algorithm.h:29
Definition: spot.h:66