ScummVM API documentation
scene2010.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_RUNAWAY_SCENE2010_H
23#define HOLLYWOOD_RUNAWAY_SCENE2010_H
24
25#include "common/random.h"
26#include "hollywood/runaway/audio.h"
27#include "hollywood/runaway/graphics.h"
28#include "hollywood/runaway/speech.h"
29#include "hollywood/runaway/video.h"
30#include "hollywood/scene_text_store.h"
31
32namespace Hollywood {
33
34// The retail opening (2010) and the interchapter narration.
35// All timing comes from the engine's pause-aware clock.
37public:
38 explicit RunawayOpening(RunawayAudio &audio) : _audio(audio), _random("runawayOpening"), _speech(audio, _random) {}
39 bool load(byte chapter = 0);
40 bool loadEndingNarration(byte cue);
41 void start(uint32 now);
42 void update(uint32 now);
43 void skip(uint32 now);
44 void skipSpeech(uint32 now);
45 void draw(Graphics::ManagedSurface &screen);
46 bool finished() const { return _step == kFinished || _failed; }
47 bool failed() const { return _failed; }
48 const Common::U32String &subtitle() const { return _speech.subtitle(); }
49
50private:
51 enum Step {
52 kSitDown, kIntroduction, kLeanForward, kQuestion, kLeanBack, kBackground,
53 kTurnToScreen, kJourney, kMontage, kTurnBack, kLastNarration,
54 kCity, kTitle, kAccident, kAccidentTitle, kAccidentEnd, kCityExit,
55 kFilm, kStayAway, kApproach, kUnconscious, kTurn, kHospital,
56 kHitman, kReply, kFilmEnd, kChapter, kChapterGesture, kFinished
57 };
58 void enter(Step step, uint32 now);
59 void advance();
60 void speak(uint16 cue, byte variation);
61 void nextLine();
62 void showLine();
63 void startMovie(const char *name, uint first, uint last);
64 bool updateMovie();
65 void drawNarrator(Graphics::ManagedSurface &screen);
66 void drawCity(Graphics::ManagedSurface &screen);
67 void drawFilm(Graphics::ManagedSurface &screen);
68 void drawTitles(Graphics::ManagedSurface &screen);
69 uint narrationVariations() const;
70 bool speaking() const { return _row != 0; }
71
72 RunawayAudio &_audio;
74 SceneTextStore _text;
75 RunawaySpeech _speech;
76 RunawayVideo _video;
77 Graphics::ManagedSurface _narratorBackground, _city, _cityTitle;
78 RunawayFilmPortrait _portraits;
79 Graphics::ManagedSurface _pictures[17]; // Sixteen pictures, then a dissolve to black.
80 RunawayAnimation _narrator[6], _cityActor, _titles[4], _credits[12];
81 Common::Array<byte> _parallax[3], _chapterTitle;
82 Step _step = kFinished;
83 uint32 _now = 0, _started = 0, _deadline = 0;
84 uint _frame = 0, _firstFrame = 0, _lastFrame = 0, _events = 0;
85 uint _bodyFrame = 20, _headBank = 1;
86 byte _chapter = 1, _chapterVariation = 0;
87 byte _narrationCue = 0;
88 bool _chapterOnly = false;
89 uint16 _row = 0, _lastRow = 0, _sample = 0;
90 bool _narrating = true, _themeStarted = false, _failed = false;
91};
92
93} // End of namespace Hollywood
94
95#endif // HOLLYWOOD_RUNAWAY_SCENE2010_H
Definition: random.h:44
Definition: ustr.h:57
Definition: managed_surface.h:51
Definition: graphics.h:54
Definition: audio.h:29
Definition: video.h:72
Definition: scene2010.h:36
Definition: speech.h:31
Definition: video.h:35
Definition: scene_text_store.h:64