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 
28 namespace M4 {
29 
30 class GrBuff {
31 protected:
32  void alloc_pixmap();
33 
34  Buffer dummy;
35  MemHandle pixmap;
36 public:
37  int32 w, h, x_off, y_off, pitch, height;
38 
39 public:
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 
51  Buffer *get_buffer();
52 
53  uint8 *get_pixmap();
54  void clear();
55 
56  void lock();
57  void release();
58  void refresh_video(int32 scrnX, int32 scrnY, int32 x1, int32 y1, int32 x2, int32 y2);
59 };
60 
61 int32 gr_buffer_free(Buffer *buf);
62 byte *gr_buffer_pointer(Buffer *buf, int32 x, int32 y);
63 const byte *gr_buffer_pointer(const Buffer *buf, int32 x, int32 y);
64 int32 gr_buffer_init(Buffer *buf, const char *name, int32 w, int32 h);
65 
75 bool gr_buffer_rect_copy_2(const Buffer *from, Buffer *to, int32 sx, int32 sy,
76  int32 dx, int32 dy, int32 w, int32 h);
77 
86 bool gr_buffer_rect_copy(Buffer *from, Buffer *to, int32 x, int32 y, int32 w, int32 h);
87 
94 int32 gr_buffer_rect_fill(Buffer *target, int32 x1, int32 y1, int32 w, int32 h);
95 
96 void GrBuff_Show(void *s, void *r, void *b, int32 destX, int32 destY);
97 
98 } // namespace M4
99 
100 #endif
int32 gr_buffer_rect_fill(Buffer *target, int32 x1, int32 y1, int32 w, int32 h)
Buffer * get_buffer()
bool gr_buffer_rect_copy_2(const Buffer *from, Buffer *to, int32 sx, int32 sy, int32 dx, int32 dy, int32 w, int32 h)
Definition: m4_types.h:67
Definition: database.h:28
Definition: gr_buff.h:30
bool gr_buffer_rect_copy(Buffer *from, Buffer *to, int32 x, int32 y, int32 w, int32 h)