2 * $Logfile: /Freespace2/code/Graphics/Rect.cpp $
7 * Routines to draw rectangles.
10 * Revision 1.1 2002/05/03 03:28:09 root
14 * 3 12/02/98 5:47p Dave
15 * Put in interface xstr code. Converted barracks screen to new format.
17 * 2 10/07/98 10:53a Dave
20 * 1 10/07/98 10:49a Dave
22 * 3 3/10/98 4:18p John
23 * Cleaned up graphics lib. Took out most unused gr functions. Made D3D
24 * & Glide have popups and print screen. Took out all >8bpp software
25 * support. Made Fred zbuffer. Made zbuffer allocate dynamically to
26 * support Fred. Made zbuffering key off of functions rather than one
29 * 2 10/26/96 2:56p John
30 * Got gradient code working.
32 * 1 10/26/96 1:32p John
39 #include "grinternal.h"
41 void grx_rect(int x,int y,int w,int h)
71 // Check for completely offscreen!
72 if ( x1 > gr_screen.clip_right )
75 if ( x2 < gr_screen.clip_left )
78 if ( y1 > gr_screen.clip_bottom )
81 if ( y2 < gr_screen.clip_top )
85 if ( x1 < gr_screen.clip_left )
86 x1 = gr_screen.clip_left;
88 if ( x2 > gr_screen.clip_right )
89 x2 = gr_screen.clip_right;
91 if ( y1 < gr_screen.clip_top )
92 y1 = gr_screen.clip_top;
94 if ( y2 > gr_screen.clip_bottom )
95 y2 = gr_screen.clip_bottom;
108 if ( Current_alphacolor ) {
109 for (i=0; i<h; i++ ) {
110 dptr = GR_SCREEN_PTR(ubyte,x1,y1+i);
113 for( j=0; j<w; j++ ) {
114 *dptr++ = Current_alphacolor->table.lookup[14][*dptr];
119 for (i=0; i<h; i++ ) {
120 dptr = GR_SCREEN_PTR(ubyte,x1,y1+i);
121 memset( dptr, gr_screen.current_color.raw8, w );