ScummVM API documentation
rend.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_REND_H
23 #define M4_GRAPHICS_REND_H
24 
25 #include "m4/m4_types.h"
26 #include "m4/gui/gui.h"
27 
28 namespace M4 {
29 
30 struct RGBcolor {
31  uint8 b, g, r;
32 };
33 
34 struct RendGrBuff {
35  uint32 Width = 0;
36  uint32 Height = 0;
37  void *PixMap = nullptr;
38  byte encoding = 0;
39  uint32 Pitch = 0;
40 };
41 
42 struct DrawRequestX {
43  int32 x; // X position relative to GrBuff(0, 0)
44  int32 y; // Y position relative to GrBuff(0, 0)
45  int32 scale_x; // X scale factor (can be negative for reverse draw)
46  int32 scale_y; // Y scale factor (can't be negative)
47  uint8 *depth_map; // Depth code array for destination (doesn't care if srcDepth is 0)
48  RGBcolor *Pal; // Palette for shadow draw (doesn't care if SHADOW bit is not set in Src.encoding)
49  uint8 *ICT; // Inverse Color Table (doesn't care if SHADOW bit is not set in Src.encoding)
50  uint8 depth; // Depth code for source (0 if no depth processing)
51 };
52 
53 struct RendCell {
54  uint32 Pack;
55  uint32 Stream;
56  long hot_x;
57  long hot_y;
58  uint32 Width;
59  uint32 Height;
60  uint32 Comp;
61  uint32 Reserved[8];
62  uint8 *data;
63 };
64 
65 enum {
66  kEndOfLine = 0,
67  kEndOfSprite = 1,
68  kJumpXY = 2
69 };
70 
71 typedef uint32 RenderResult;
72 
73 typedef RenderResult(*RenderFunc)();
74 
75 struct Rend_Globals {
76  uint8 *_sourceAddress, *_destinationAddress, *_depthAddress, _spriteDepth, *_InverseColorTable;
77  int32 _X_scale, _LeftPorch, _RightPorch, _StartingPixelPos, _X_error;
78  int _Increment;
79  RGBcolor *_Palette;
80 };
81 
82 void GetUpdateRectangle(int32 x, int32 y, int32 hot_x, int32 hot_y, int32 scale_x, int32 scale_y, int32 Width, int32 Height, M4Rect *UpdateRect);
83 void render_sprite_to_8BBM(RendGrBuff *Destination, DrawRequestX *dr, RendCell *Frame, M4Rect *ClipRectangle, M4Rect *UpdateRect);
84 
85 } // namespace M4
86 
87 #endif
Definition: rend.h:53
Definition: rend.h:34
Definition: rend.h:30
Definition: rend.h:42
Definition: database.h:28
Definition: rend.h:75
Definition: gui.h:52