ScummVM API documentation
scene9120.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_INTRO_SCENE9120_H
23#define HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9120_H
24
25#include "common/array.h"
26#include "common/random.h"
27
28#include "hollywood/monsters/music.h"
29#include "hollywood/monsters/scenes/presentation_scene.h"
30
31namespace Hollywood {
32
33class HollywoodEngine;
34
36public:
38
39 bool play();
40
41private:
42 bool loadResourceI12Assets();
43
44 void runTimedOverlayPhase();
45 void runHoldScrollAndIdlePhase();
46 void advanceActorBob();
47 void advanceSmallAnimation();
48 void restoreAndDrawResourceDescriptorFrame(byte localChunkIndex, byte descriptorCount, byte descriptorIndex, bool drawFrame);
49 byte getTimedOverlayChunk(uint tickIndex) const;
50
51 void copyViewportToSavedFramebuffer();
52 void clearActiveViewport();
53 void drawTimedOverlayChunk(uint32 baseOffset);
54 void revealSavedViewportCurtainBand(uint sweepOffset, byte bandWidth);
55 void clearViewportCurtainBand(uint sweepOffset, byte bandWidth);
56 void copySavedRunToScene(int sourceY, int destinationY, int x, int width);
57 void clearSceneRun(int destinationY, int x, int width);
58
59 uint presentRowOffset() const override;
60 uint presentXOffset() const override;
61 void stopAudio() override;
62
63 enum {
64 kScene9120FramebufferSize = 0xeb000,
65 kI12RequiredChunkCount = 10,
66 kScene9120InitialYOffset = 0x1cc,
67 kScene9120TimedOverlayTicks = 0x181,
68 kScene9120OverlayInterval = 16,
69 kScene9120ScrollInterval = 50,
70 kScene9120ActorBobInterval = 60,
71 kScene9120SmallAnimInterval = 60,
72 kScene9120HoldMillis = 13000,
73 kScene9120ActorBobDescriptorCount = 10,
74 kScene9120SmallAnimDescriptorCount = 3
75 };
76
77 MusicPlayer *_music;
78 SoundBank0Player _soundBank0;
80 Common::Array<byte> _paletteResource;
81 IndexedSurfaceBuffer _descriptorBackground;
82 uint32 _overlayAccumulator;
83 uint32 _scrollAccumulator;
84 uint32 _actorBobAccumulator;
85 uint32 _smallAnimAccumulator;
86 uint16 _xOffset;
87 uint16 _yOffset;
88 byte _actorBobTicksRemaining;
89 byte _actorBobFramePhase;
90 int _actorBobDelta;
91 byte _smallAnimSequenceState;
92 byte _smallAnimFrame;
93 bool _viewportDirty;
94};
95
96} // End of namespace Hollywood
97
98#endif // HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9120_H
Definition: random.h:44
Definition: hollywood.h:47
Definition: graphics.h:74
Definition: music.h:31
Definition: presentation_scene.h:38
Definition: scene9120.h:35
Definition: music.h:82