ScummVM API documentation
graphics.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 SUPERNOVA_GRAPHICS_H
23 #define SUPERNOVA_GRAPHICS_H
24 
25 #include "common/scummsys.h"
26 #include "image/image_decoder.h"
27 #include "supernova/supernova.h"
28 
29 namespace Common {
30 class SeekableReadStream;
31 }
32 
33 namespace Graphics {
34 struct Surface;
35 }
36 
37 namespace Supernova {
38 class SupernovaEngine;
39 
40 class MSNImage : public Image::ImageDecoder {
41 public:
43  ~MSNImage() override;
44 
45  void destroy() override;
46  bool loadStream(Common::SeekableReadStream &stream) override;
47  const Graphics::Surface *getSurface() const override { return _sectionSurfaces[0]; }
48  const byte *getPalette() const override { return _palette; }
49 
50  bool init(int filenumber);
51 
52  static const int kMaxSections = 50;
53  static const int kMaxClickFields = 80;
54  static const uint32 kInvalidAddress = 0x00FFFFFF;
55 
56  int _filenumber;
57  int _pitch;
58  int _numSections;
59  int _numClickFields;
60  Common::Array<Graphics::Surface *> _sectionSurfaces;
61  byte *_palette;
62  byte *_encodedImage;
63 
64  struct Section {
65  int16 x1;
66  int16 x2;
67  byte y1;
68  byte y2;
69  byte next;
70  uint16 addressLow;
71  byte addressHigh;
72  } _section[kMaxSections];
73 
74  struct ClickField {
75  int16 x1;
76  int16 x2;
77  byte y1;
78  byte y2;
79  byte next;
80  } _clickField[kMaxClickFields];
81 
82 private:
83  SupernovaEngine *_vm;
84  bool loadFromEngineDataFile();
85  bool loadPbmFromEngineDataFile();
86  bool loadSections();
87 };
88 
89 }
90 #endif
Definition: image_decoder.h:52
Definition: supernova.h:61
Definition: surface.h:67
Definition: console.h:27
Definition: stream.h:745
Definition: graphics.h:74
const Graphics::Surface * getSurface() const override
Definition: graphics.h:47
Definition: algorithm.h:29
Definition: formatinfo.h:28
const byte * getPalette() const override
Definition: graphics.h:48
Definition: graphics.h:40
Definition: graphics.h:64