ScummVM API documentation
gr_buff.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_BUFF_H
23#define M4_GRAPHICS_GR_BUFF_H
24
25#include "m4/m4_types.h"
26#include "m4/mem/reloc.h"
27
28namespace M4 {
29
30class GrBuff {
31protected:
32 void alloc_pixmap();
33
34 Buffer dummy{};
35 MemHandle pixmap = nullptr;
36public:
37 int32 w, h, x_off, y_off, pitch, height;
38
39public:
40 GrBuff(int32 _w, int32 _h);
41 GrBuff(int32 _w, int32 _h, int32 _x_off, int32 _y_off, int32 _pitch, int32 _height);
42 virtual ~GrBuff();
43
52
53 uint8 *get_pixmap();
54
55 void lock();
56 void release();
57 void refresh_video(int32 scrnX, int32 scrnY, int32 x1, int32 y1, int32 x2, int32 y2);
58};
59
60int32 gr_buffer_free(Buffer *buf);
61byte *gr_buffer_pointer(Buffer *buf, int32 x, int32 y);
62const byte *gr_buffer_pointer(const Buffer *buf, int32 x, int32 y);
63void gr_buffer_init(Buffer *buf, const char *name, int32 w, int32 h);
64
74bool gr_buffer_rect_copy_2(const Buffer *from, Buffer *to, int32 sx, int32 sy,
75 int32 dx, int32 dy, int32 w, int32 h);
76
85bool gr_buffer_rect_copy(Buffer *from, Buffer *to, int32 x, int32 y, int32 w, int32 h);
86
93int32 gr_buffer_rect_fill(Buffer *target, int32 x1, int32 y1, int32 w, int32 h);
94
95void GrBuff_Show(void *s, void *r, void *b, int32 destX, int32 destY);
96
97} // namespace M4
98
99#endif
Definition: gr_buff.h:30
Buffer * get_buffer()
Definition: database.h:28
int32 gr_buffer_rect_fill(Buffer *target, int32 x1, int32 y1, int32 w, int32 h)
bool gr_buffer_rect_copy_2(const Buffer *from, Buffer *to, int32 sx, int32 sy, int32 dx, int32 dy, int32 w, int32 h)
bool gr_buffer_rect_copy(Buffer *from, Buffer *to, int32 x, int32 y, int32 w, int32 h)
Definition: m4_types.h:54