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