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 = 0;
// X position relative to GrBuff(0, 0)
44
int32 y = 0;
// Y position relative to GrBuff(0, 0)
45
int32 scale_x = 0;
// X scale factor (can be negative for reverse draw)
46
int32 scale_y = 0;
// Y scale factor (can't be negative)
47
uint8 *depth_map =
nullptr
;
// Depth code array for destination (doesn't care if srcDepth is 0)
48
RGBcolor
*Pal =
nullptr
;
// Palette for shadow draw (doesn't care if SHADOW bit is not set in Src.encoding)
49
uint8 *ICT =
nullptr
;
// Inverse Color Table (doesn't care if SHADOW bit is not set in Src.encoding)
50
uint8 depth = 0;
// Depth code for source (0 if no depth processing)
51
};
52
53
struct
RendCell
{
54
uint32 Pack = 0;
55
uint32 Stream = 0;
56
long
hot_x = 0;
57
long
hot_y = 0;
58
uint32 Width = 0;
59
uint32 Height = 0;
60
uint32 Comp = 0;
61
uint32 Reserved[8] = {};
62
uint8 *data =
nullptr
;
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 =
nullptr
;
77
uint8 *_destinationAddress =
nullptr
;
78
uint8 *_depthAddress =
nullptr
;
79
uint8 _spriteDepth = 0;
80
uint8 *_InverseColorTable =
nullptr
;
81
int32 _X_scale = 0;
82
int32 _LeftPorch = 0;
83
int32 _RightPorch = 0;
84
int32 _StartingPixelPos = 0;
85
int32 _X_error = 0;
86
int
_Increment = 0;
87
RGBcolor
*_Palette =
nullptr
;
88
};
89
90
void
GetUpdateRectangle(int32 x, int32 y, int32 hot_x, int32 hot_y, int32 scale_x, int32 scale_y, int32 Width, int32 Height,
M4Rect
*UpdateRect);
91
void
render_sprite_to_8BBM(
RendGrBuff
*Destination,
DrawRequestX
*dr,
RendCell
*Frame,
M4Rect
*ClipRectangle,
M4Rect
*UpdateRect);
92
93
}
// namespace M4
94
95
#endif
M4::RendCell
Definition:
rend.h:53
M4::RendGrBuff
Definition:
rend.h:34
M4::RGBcolor
Definition:
rend.h:30
M4::DrawRequestX
Definition:
rend.h:42
M4
Definition:
database.h:28
M4::Rend_Globals
Definition:
rend.h:75
M4::M4Rect
Definition:
gui.h:52
engines
m4
graphics
rend.h
Generated on Mon Mar 9 2026 09:18:47 for ScummVM API documentation by
1.8.13