ScummVM API documentation
picture.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 AGI_PICTURE_H
23#define AGI_PICTURE_H
24
25namespace Agi {
26
27#define _DEFAULT_WIDTH 160
28#define _DEFAULT_HEIGHT 168
29
33struct AgiPicture {
34 uint32 flen;
35 uint8 *rdata;
37 void reset() {
38 flen = 0;
39 rdata = nullptr;
40 }
41
42 AgiPicture() { reset(); }
43};
44
45class AgiBase;
46class GfxMgr;
47
49public:
50 PictureMgr(AgiBase *agi, GfxMgr *gfx);
51 virtual ~PictureMgr() { }
52
53 int16 getResourceNr() const { return _resourceNr; };
54
55protected:
56 virtual byte getInitialPriorityColor() const { return 4; }
57
58 void putVirtPixel(int16 x, int16 y);
59 void xCorner(bool skipOtherCoords = false);
60 void yCorner(bool skipOtherCoords = false);
61 virtual void plotPattern(byte x, byte y);
62 virtual void plotBrush();
63
64 byte getNextByte();
65 bool getNextParamByte(byte &b);
66 byte getNextNibble();
67
68 virtual bool getNextXCoordinate(byte &x);
69 virtual bool getNextYCoordinate(byte &y);
70 bool getNextCoordinates(byte &x, byte &y);
71
72 virtual bool getGraphicsCoordinates(int16 &x, int16 &y);
73
74public:
75 void decodePicture(int16 resourceNr, bool clearScreen, bool agi256 = false, int16 width = _DEFAULT_WIDTH, int16 height = _DEFAULT_HEIGHT);
76 void decodePictureFromBuffer(byte *data, uint32 length, bool clearScreen, int16 width = _DEFAULT_WIDTH, int16 height = _DEFAULT_HEIGHT);
77
78protected:
79 virtual void drawPicture();
80 void drawPicture_AGI256();
81
82 void draw_SetColor();
83 void draw_SetPriority();
84 void draw_SetNibbleColor();
85 void draw_SetNibblePriority();
86
87 virtual void draw_Line(int16 x1, int16 y1, int16 x2, int16 y2);
88 void draw_LineShort();
89 void draw_LineAbsolute();
90
91 virtual bool draw_FillCheck(int16 x, int16 y, bool horizontalCheck);
92 virtual void draw_Fill(int16 x, int16 y);
93 virtual void draw_Fill();
94
95public:
96 void showPicture(int16 x = 0, int16 y = 0, int16 width = _DEFAULT_WIDTH, int16 height = _DEFAULT_HEIGHT);
97 void showPictureWithTransition();
98
99protected:
100 AgiBase *_vm;
101 GfxMgr *_gfx;
102
103 int16 _resourceNr;
104 uint8 *_data;
105 uint32 _dataSize;
106 uint32 _dataOffset;
107 bool _dataOffsetNibble;
108
109 uint8 _patCode;
110 uint8 _patNum;
111 uint8 _priOn;
112 uint8 _scrOn;
113 uint8 _scrColor;
114 uint8 _priColor;
115
116 uint8 _minCommand;
117
118 int16 _width;
119 int16 _height;
120};
121
122} // End of namespace Agi
123
124#endif /* AGI_PICTURE_H */
Definition: agi.h:573
Definition: graphics.h:58
Definition: picture.h:48
Definition: agi.h:64
Definition: picture.h:33
uint8 * rdata
Definition: picture.h:35
uint32 flen
Definition: picture.h:34