ScummVM API documentation
lightning.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 NANCY_MISC_LIGHTNING_H
23 #define NANCY_MISC_LIGHTNING_H
24 
25 #include "engines/nancy/commontypes.h"
26 
27 namespace Nancy {
28 namespace Misc {
29 
30 // Special class that handles The Vampire Diaries' lightning screen effect.
31 // Activated by the LightningOn action record as well as at the endgame section
32 class Lightning {
33 public:
34  enum LightningState { kBegin, kStartPulse, kPulse, kThunder, kNotRunning };
35 
36  void beginLightning(int16 distance, uint16 pulseTime, int16 rgbPercent);
37  void endLightning();
38 
39  void run();
40 
41 private:
42  void handlePulse(bool on);
43  void handleThunder();
44 
45  //bool _isRunning = false;
46  LightningState _state = kNotRunning;
47 
48  int16 _minRGBPercent = 0;
49  int16 _maxRGBPercent = 0;
50 
51  int16 _minInterPulseDelay = 0;
52  int16 _maxInterPulseDelay = 0;
53 
54  int16 _minPulseLength = 5;
55  int16 _maxPulseLength = 0;
56 
57  int16 _minSoundStartDelay = 0;
58  int16 _maxSoundStartDelay = 0;
59 
60  uint32 _nextStateTime = 0;
61  uint32 _nextSoundTime0 = 0;
62  uint32 _nextSoundTime1 = 0;
63 
64  int _nextSoundToPlay = 0;
65 
66  Common::Array<RenderObject *> _viewportObjs;
67  Common::Array<byte *> _viewportObjOriginalPalettes;
68 };
69 
70 } // End of namespace Misc
71 } // End of namespace Nancy
72 
73 #endif // NANCY_MISC_LIGHTNING_H
Definition: array.h:52
Definition: lightning.h:32
Definition: actionmanager.h:32