3 Extension to the Quick and Dirty Game Development Framework (QDGDF)
5 Copyright (C) 2001 Daniel Compton <C_Anon01@yahoo.com>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
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.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef QDGDF_VIDEO_EXT_H_
24 #define QDGDF_VIDEO_EXT_H_
29 #include "qdgdf_video.h"
31 #define RGB(r, g, b) (((unsigned char)(r) | ((unsigned short)((unsigned char)(g)) << 8)) | \
32 (((unsigned int)(unsigned char)(b)) << 16))
34 #define GetRValue(rgb) ((unsigned char)(rgb))
35 #define GetGValue(rgb) ((unsigned char)(((unsigned short)(rgb)) >> 8))
36 #define GetBValue(rgb) ((unsigned char)((rgb) >> 16))
38 /* no protections on any memory overwrite errors */
39 void qdgdfv_display_pcx(unsigned char *pcx
, unsigned int w
, unsigned int h
,
40 unsigned int x
, unsigned int y
);
42 /* safe: this will cut the image off if it will not fit in the virtual screen */
43 /* returns 0 if the image will not fit at all (no writting will be done), 1 otherwise */
44 int qdgdfv_display_pcx_safe(unsigned char *pcx
, unsigned int w
,
45 unsigned int h
, unsigned int x
,
48 /* full: this will move the image so that the whole image will be viewable and not cut off */
49 /* returns 0 if the image will not fit at all (no writting will be done), 1 otherwise */
50 int qdgdfv_display_pcx_full(unsigned char *pcx
, unsigned int w
,
51 unsigned int h
, unsigned int x
,
54 unsigned char qdgdfv_find_color(unsigned int r
, unsigned int g
,
57 int qdgdfv_plot_pixel_color(unsigned int x
, unsigned int y
,
60 int qdgdfv_plot_pixel_rgb(unsigned int x
, unsigned int y
,
63 int qdgdfv_draw_rect_fill(unsigned int x
, unsigned int y
, unsigned int w
,
64 unsigned int h
, unsigned char color
);
66 #define qdgdfv_draw_hline(x, y, w, thick, color) \
67 qdgdfv_draw_rect_fill((unsigned int)x, (unsigned int)y, (unsigned int)w, (unsigned int)thick, (unsigned char)color)
69 #define qdgdfv_draw_vline(x, y, h, thick, color) \
70 qdgdfv_draw_rect_fill((unsigned int)x, (unsigned int)y, (unsigned int)thick, (unsigned int)h, (unsigned char)color)
72 int qdgdfv_draw_rect(unsigned int x
, unsigned int y
, unsigned int w
,
73 unsigned int h
, unsigned int wallw
,
76 #define qdgdfv_clear_screen_at(x, y, w, h) \
77 qdgdfv_draw_rect_fill((unsigned int)x, (unsigned int)y, (unsigned int)w, (unsigned int)h, \
80 #endif /* QDGDF_VIDEO_EXT_H_ */