ScummVM API documentation
speech_controller.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 HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SPEECH_CONTROLLER_H
23#define HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SPEECH_CONTROLLER_H
24
25#include "common/random.h"
26#include "common/types.h"
27
28#include "hollywood/monsters/music.h"
29#include "hollywood/monsters/scenes/speech_overlay.h"
30
31namespace Hollywood {
32
40public:
41 SpeechController(Common::Language language, bool speechEnabled = true);
42
43 void initialize(byte secondaryTextColor, byte primaryTextColor);
44 void resetRuntimeState(byte invalidPrimaryGroup, byte defaultPrimaryFrame);
45 void clearSecondaryOverlay();
46 void clearPrimaryOverlay();
47 void clearAllOverlays();
48 void prepareSecondaryActorSpeech();
49 void advanceSecondaryActorSpeechAnimation(uint32 delta, Common::RandomSource &random,
50 uint32 frameMillis, byte frameCount);
51 void advanceSecondaryActorSpeechFrame(Common::RandomSource &random, byte frameCount);
52 byte advancePrimaryLeftSpeechFrame(Common::RandomSource &random);
53 byte advancePrimaryDialogueSpeechFrame(Common::RandomSource &random, byte baseFrame, byte frameCount);
54 void startPrimaryLeftSpeech();
55 void stopPrimaryLeftSpeech();
56 void startPrimaryDialogueSpeech(byte animationGroup, byte baseFrame);
57 void stopPrimaryDialogueSpeech(byte invalidPrimaryGroup, byte defaultPrimaryFrame);
58
59 SpeechPlayer _player;
60 SpeechOverlay _secondaryOverlay;
61 SpeechOverlay _primaryOverlay;
62 byte _primaryLeftSpeechLastFrame;
63 byte _primaryDialogueSpeechLastFrame;
64 byte _primaryDialogueSpeechGroup;
65 bool _primaryLeftSpeechActive;
66 bool _primaryDialogueSpeechActive;
67 uint32 _secondaryActorTimerAccumulator;
68 uint32 _primaryLeftSpeechTimerAccumulator;
69 uint32 _primaryDialogueSpeechTimerAccumulator;
70 byte _secondaryActorFrame;
71};
72
73} // End of namespace Hollywood
74
75#endif // HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SPEECH_CONTROLLER_H
Definition: random.h:44
Definition: speech_controller.h:39
Definition: music.h:57
Language
Definition: language.h:45
Definition: speech_overlay.h:38