ScummVM API documentation
movie.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 
23 #ifndef GAMOS_MOVIE_H
24 #define GAMOS_MOVIE_H
25 
26 #include "common/file.h"
27 
28 namespace Gamos {
29 
30 class GamosEngine;
31 
32 class MoviePlayer {
33 public:
34 
35  bool playMovie(Common::File *file, uint32 offset, GamosEngine *gamos);
36 
37 
38 private:
39 
40  bool init(Common::File *file, uint32 offset, GamosEngine *gamos);
41  bool deinit();
42  bool error();
43 
44  int processControlChunk();
45  int processImageChunk();
46  int processPaletteChunk();
47  int processSoundChunk();
48  int proccessMidiChunk();
49 
50  bool readHdr();
51  bool readCompressed(int32 count, Common::Array<byte> *buf);
52 
53  uint8 processMessages(bool keepAct, uint32 *msecs);
54 
55  static byte *blit0(Common::Rect rect, byte *in, Graphics::Surface *surface);
56  static byte *blit1(Common::Rect rect, byte *in, Graphics::Surface *surface);
57  static byte *blit2(Common::Rect rect, byte *in, Graphics::Surface *surface);
58  static byte *blit3(Common::Rect rect, byte *in, Graphics::Surface *surface);
59 
60 
61 
62 private:
63 
64  GamosEngine *_gamos = nullptr;
65  Graphics::Screen *_screen = nullptr;
66  SystemProc *_messageProc = nullptr;
67 
68 
69  bool _doUpdateScreen = false;
70  uint32 _skippedFrames = 0;
71  uint32 _currentFrame = 0;
72  uint32 _firstFrameTime = 0;
73 
74  bool _forceStopMidi = false;
75 
76  int _loopCount = 1;
77  int _loopPoint = 0;
78 
79  Common::Point _pos; /* Movie frame leftup corner */
80  Common::Point _frameSize; /* Sizes of movie frame */
81 
82  int _midiBufferSize = 0;
83  int _soundBufferSize = 0;
84  int _paletteBufferSize = 0;
85  int _bufferSize = 0;
86  int _packedBufferSize = 0;
87  int _frameTime = 0;
88 
89  Common::Array<byte> _midiBuffer;
90  Common::Array<byte> _soundBuffer;
91  Common::Array<byte> _paletteBuffer;
92  Common::Array<byte> _buffer;
93  Common::Array<byte> _packedBuffer;
94 
95  bool _midiStarted = false;
96  bool _soundPlaying = false;
97 
98  Common::File *_file = nullptr;
99 
100  byte _hdrBytes[4];
101  int32 _hdrValue1 = 0;
102  int32 _hdrValue2 = 0;
103 };
104 
105 }
106 
107 #endif //GAMOS_MOVIE_H
Definition: surface.h:67
Definition: rect.h:524
Definition: screen.h:48
Definition: blit.h:28
Definition: movie.h:32
Definition: file.h:47
Definition: gamos.h:376
Definition: rect.h:144
Definition: proc.h:39