aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova/graphics.h
blob: 585aabe260cf68388d06ccc497cae84764db35c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef GRAPHICS_H
#define GRAPHICS_H

#include "common/scummsys.h"
#include "image/image_decoder.h"

namespace Common {
class SeekableReadStream;
}

namespace Graphics {
struct Surface;
}

namespace Supernova {

class MSNImageDecoder : public Image::ImageDecoder {
public:
	MSNImageDecoder();
	virtual ~MSNImageDecoder();

	virtual void destroy();
	virtual bool loadStream(Common::SeekableReadStream &stream);
	virtual const Graphics::Surface *getSurface() const { return _surface; }
	virtual const byte *getPalette() const { return _palette; }
	
	bool loadSection(int _section);

private:
	static const int kMaxSections = 50;
	static const int kMaxClickFields = 80;
	
	Graphics::Surface *_surface;
	byte *_palette;
	byte *_encodedImage;
	
	struct Section {
		int16  x1;
		int16  x2;
		byte   y1;
		byte   y2;
		byte   next;
		uint16 addressLow;
		byte   addressHigh;
	} _section[kMaxSections];

	struct ClickField {
		int16  x1;
		int16  x2;
		byte   y1;
		byte   y2;
		byte   next;
	} _clickField[kMaxClickFields];
};

}
#endif