ScummVM API documentation
data.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 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef VOYEUR_DATA_H
23#define VOYEUR_DATA_H
24
25#include "common/scummsys.h"
26#include "common/serializer.h"
27#include "voyeur/files.h"
28
29namespace Voyeur {
30
31#define TOTAL_EVENTS 1000
32
33enum VoyeurEventType {
34 EVTYPE_NONE = 0,
35 EVTYPE_VIDEO = 1,
36 EVTYPE_AUDIO = 2,
37 EVTYPE_EVID = 3,
38 EVTYPE_COMPUTER = 4
39};
40
41enum EventFlag { EVTFLAG_TIME_DISABLED = 1, EVTFLAG_2 = 2, EVTFLAG_8 = 8, EVTFLAG_RECORDING = 0x10,
42 EVTFLAG_40 = 0x40, EVTFLAG_VICTIM_PRESET = 0x80, EVTFLAG_100 = 0x100 };
43
45 int _hour;
46 int _minute;
47 bool _isAM;
48 VoyeurEventType _type;
49 int _audioVideoId;
50 int _computerOn;
51 int _computerOff;
52 int _dead;
53
54 void synchronize(Common::Serializer &s);
55};
56
57class VoyeurEngne;
58
63template<int SLOTS>
65public:
66 int _min[SLOTS][20]; // Min time expired
67 int _max[SLOTS][20]; // Max time expired
68
69 HotspotTimes() {
70 reset();
71 }
72
76 void reset() {
77 for (int hotspotIdx = 0; hotspotIdx < 20; ++hotspotIdx) {
78 for (int slotIdx = 0; slotIdx < SLOTS; ++slotIdx) {
79 _min[slotIdx][hotspotIdx] = 9999;
80 _max[slotIdx][hotspotIdx] = 0;
81 }
82 }
83 }
84
89 for (int slotIndex = 0; slotIndex < SLOTS; ++slotIndex) {
90 for (int hotspotIndex = 0; hotspotIndex < 20; ++hotspotIndex) {
91 s.syncAsSint16LE(_min[slotIndex][hotspotIndex]);
92 s.syncAsSint16LE(_max[slotIndex][hotspotIndex]);
93 }
94 }
95 }
96
101 bool isInRange(int slotIndex, int hotspotIndex, int v) const {
102 return _min[slotIndex][hotspotIndex] <= v &&
103 v < _max[slotIndex][hotspotIndex];
104 }
105};
106
107class SVoy {
108private:
109 VoyeurEngine *_vm;
110
111public:
112 bool _abortInterface;
113 bool _isAM;
114 bool _phoneCallsReceived[5];
115 bool _roomHotspotsEnabled[32];
116 bool _victimMurdered;
117
118 int _aptLoadMode;
119 int _audioVisualStartTime;
120 int _audioVisualDuration;
121 int _boltGroupId2;
122 int _computerTextId;
123 int _computerTimeMin;
124 int _computerTimeMax;
125 int _eventCount;
126 int _eventFlags;
127 int _fadingAmount1;
128 int _fadingAmount2;
129 int _fadingStep1;
130 int _fadingStep2;
131 int _fadingType;
132 int _incriminatedVictimNumber;
133 int _murderThreshold;
134 int _musicStartTime;
135 int _playStampMode;
136 int _switchBGNum;
137 int _totalPhoneCalls;
138 int _transitionId;
139 int _videoEventId;
140 int _vocSecondsOffset;
141 int _RTANum;
142 int _RTVLimit;
143 int _RTVNum;
144
145 HotspotTimes<3> _audioHotspotTimes;
146 HotspotTimes<3> _evidenceHotspotTimes;
147 HotspotTimes<8> _videoHotspotTimes;
148
149 Common::Rect _computerScreenRect;
150 RectResource *_viewBounds;
151 PictureResource *_evPicPtrs[6];
152 CMapResource *_evCmPtrs[6];
153 VoyeurEvent _events[TOTAL_EVENTS];
154
155 SVoy(VoyeurEngine *vm);
156
161
165 void addEvent(int hour, int minute, VoyeurEventType type, int audioVideoId,
166 int on, int off, int dead);
167
172
177
182
187
191 void addEvidEventStart(int v);
192
196 void addEvidEventEnd(int totalPages);
197
202
207
211 void reviewAnEvidEvent(int eventIndex);
212
216 void reviewComputerEvent(int eventIndex);
217
223
224private:
225 int _policeEvent;
226};
227
228} // End of namespace Voyeur
229
230#endif /* VOYEUR_DATA_H */
Definition: serializer.h:80
Definition: files.h:421
Definition: data.h:64
void synchronize(Common::Serializer &s)
Definition: data.h:88
void reset()
Definition: data.h:76
bool isInRange(int slotIndex, int hotspotIndex, int v) const
Definition: data.h:101
Definition: files.h:279
Definition: files.h:224
Definition: data.h:107
void reviewAnEvidEvent(int eventIndex)
void addVideoEventStart()
void addEvent(int hour, int minute, VoyeurEventType type, int audioVideoId, int on, int off, int dead)
void reviewComputerEvent(int eventIndex)
void addAudioEventStart()
bool checkForKey()
void addAudioEventEnd()
void synchronize(Common::Serializer &s)
void addComputerEventStart()
void addComputerEventEnd(int v)
void addVideoEventEnd()
void addEvidEventStart(int v)
void addEvidEventEnd(int totalPages)
Definition: voyeur.h:78
Definition: animation.h:38
Definition: rect.h:536
Definition: data.h:44