ScummVM API documentation
screen_decoder.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 MM1_GFX_SCREEN_DECODER_H
23 #define MM1_GFX_SCREEN_DECODER_H
24 
25 #include "image/image_decoder.h"
26 #include "graphics/managed_surface.h"
27 
28 namespace MM {
29 namespace MM1 {
30 namespace Gfx {
31 
33 private:
34  Graphics::Surface _surface;
35 public:
36  byte _indexes[4] = { 0 }; // EGA palete indexes used
37 public:
38  ScreenDecoder() {}
39  ~ScreenDecoder() override;
40 
41  void destroy() override;
42  bool loadFile(const Common::Path &fname,
43  int16 w = 320, int16 h = 200);
44  bool loadStream(Common::SeekableReadStream &stream, int16 w, int16 h);
45  bool loadStream(Common::SeekableReadStream &stream) override {
46  return loadStream(stream, 320, 200);
47  }
48 
49  const Graphics::Surface *getSurface() const override {
50  return &_surface;
51  }
52  const byte *getPalette() const override { return nullptr; }
53  uint16 getPaletteColorCount() const override { return 0; }
54  void clear() { _surface.free(); }
55 };
56 
57 } // namespace Gfx
58 } // namespace MM1
59 } // namespace MM
60 
61 #endif
Definition: image_decoder.h:52
Definition: surface.h:67
Definition: path.h:52
Definition: stream.h:745
uint16 getPaletteColorCount() const override
Definition: screen_decoder.h:53
const Graphics::Surface * getSurface() const override
Definition: screen_decoder.h:49
const byte * getPalette() const override
Definition: screen_decoder.h:52
Definition: detection.h:27
bool loadStream(Common::SeekableReadStream &stream) override
Definition: screen_decoder.h:45
Definition: screen_decoder.h:32