ScummVM API documentation
intro.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_INTRO_H
23#define HOLLYWOOD_RUNAWAY_INTRO_H
24
25#include "hollywood/runaway/audio.h"
26#include "hollywood/runaway/graphics.h"
27#include "hollywood/runaway/presentation.h"
28#include "hollywood/runaway/scene2010.h"
29
30namespace Hollywood {
31
32// Animated Pendulo logo, then the demo story card or retail opening.
33// The engine supplies its pause-aware clock and handles input/presentation.
35public:
36 enum Mode { kCompleteIntro, kLogoOnly, kOpeningOnly };
37 explicit RunawayIntro(Audio::Mixer *mixer) : _audio(mixer), _opening(_audio) {}
38 bool load(bool fullGame = false, byte chapter = 0, Mode mode = kCompleteIntro);
39 void start(uint32 now);
40 void skip(uint32 now);
41 void skipSpeech(uint32 now);
42 void update(uint32 now);
43 void draw();
44 bool finished() const { return _phase == kFinished; }
45 bool failed() const { return _opening.failed(); }
46 const Common::U32String &subtitle() const { return _opening.subtitle(); }
47 Graphics::ManagedSurface &screen() { return _screen; }
48
49private:
50 void skipPresentation(uint32 now) override { skip(now); }
51 void skipPresentationSpeech(uint32 now) override { skipSpeech(now); }
52
53 enum Phase { kLogo, kLogoAudio, kStoryFadeIn, kStory, kStoryFadeOut, kOpening, kFinished };
54 void startStory(uint32 now);
55
56 RunawayAudio _audio;
57 RunawayOpening _opening;
58 bool _fullGame = false;
59 byte _chapter = 0;
60 Mode _mode = kCompleteIntro;
61 RunawayAnimation _logo[3];
62 Graphics::ManagedSurface _story, _screen;
63 Phase _phase = kFinished;
64 uint32 _phaseStarted = 0;
65 uint32 _storyFadeDuration = 0;
66 int _logoFrames[3] = { -1, -1, -1 };
67 uint _brightness = 255;
68};
69
70} // End of namespace Hollywood
71
72#endif // HOLLYWOOD_RUNAWAY_INTRO_H
Definition: mixer.h:70
Definition: ustr.h:57
Definition: managed_surface.h:51
Definition: graphics.h:54
Definition: audio.h:29
Definition: intro.h:34
Definition: scene2010.h:36
Definition: presentation.h:42