ScummVM API documentation
gr_sprite.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 M4_GRAPHICS_GR_SPRITE_H
23 #define M4_GRAPHICS_GR_SPRITE_H
24 
25 #include "m4/m4_types.h"
26 #include "m4/gui/gui.h"
27 
28 namespace M4 {
29 
30 enum {
31  NO_COMPRESS = 0x00,
32  RLE8 = 0x01,
33  SHADOW = 0x80
34 };
35 
36 struct DrawRequest {
37  Buffer *Src = nullptr; // sprite source buffer
38  Buffer *Dest = nullptr; // destination buffer
39  int32 x = 0; // x position relative to Destination(0, 0)
40  int32 y = 0; // y position relative to Destination(0, 0)
41  int32 scaleX = 0; // x scale factor (can be negative for reverse draw)
42  int32 scaleY = 0; // y scale factor (can't be negative)
43  uint8 *depthCode = nullptr; // depth code array for destination (doesn't care if srcDepth is 0)
44  uint8 *Pal = nullptr; // palette for shadow draw (doesn't care if SHADOW bit is not set in Src.encoding)
45  uint8 *ICT = nullptr; // Inverse Color Table (doesn't care if SHADOW bit is not set in Src.encoding)
46  uint8 srcDepth = 0; // depth code for source (0 if no depth processing)
47 };
48 
49 
50 uint32 gr_sprite_RLE8_encode(Buffer *Source, Buffer *Dest);
51 uint8 gr_sprite_draw(DrawRequest *DrawReq);
52 
53 } // namespace M4
54 
55 #endif
Definition: m4_types.h:67
Definition: database.h:28
Definition: gr_sprite.h:36