ScummVM API documentation
ambient.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 AMBIENT_H_
23 #define AMBIENT_H_
24 
25 #include "common/array.h"
26 
27 namespace Myst3 {
28 
29 class Myst3Engine;
30 
31 class Ambient {
32 public:
33  Ambient(Myst3Engine *vm);
34  virtual ~Ambient();
35 
36  void playCurrentNode(uint32 volume, uint32 fadeOutDelay);
37  void loadNode(uint32 node, uint32 room, uint32 age);
38  void applySounds(uint32 fadeOutDelay);
39  void scaleVolume(uint32 volume);
40 
41  void addSound(uint32 id, int32 volume, int32 heading, int32 headingAngle, int32 u1, int32 fadeOutDelay);
42 
43  void setCueSheet(uint32 id, int32 volume, int32 heading, int32 headingAngle);
44  void updateCue();
45 
46  uint32 _scriptAge;
47  uint32 _scriptRoom;
48 
49 private:
50  Myst3Engine *_vm;
51 
52  struct AmbientSound {
53  uint32 id;
54  //char name[32];
55 
56  int32 volume;
57  int32 volumeFlag;
58  int32 heading;
59  int32 headingAngle;
60  int32 u1;
61  int32 fadeOutDelay;
62 
63  void reset() {
64  id = 0;
65  volume = 0;
66  volumeFlag = 0;
67  heading = 0;
68  headingAngle = 0;
69  u1 = 0;
70  fadeOutDelay = 0;
71  }
72  };
73 
74  uint16 delayForCue(uint32 id);
75  uint32 nextCueSound(uint32 id);
76 
78 
79  AmbientSound _cueSheet;
80  uint32 _cueStartTick;
81 };
82 
83 } // End of namespace Myst3
84 
85 #endif // AMBIENT_H_
Definition: ambient.h:31
Definition: ambient.h:27
Definition: myst3.h:87