2 * $Logfile: /Freespace2/code/Graphics/Gradient.cpp $
7 * Routines to draw rectangular gradients.
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:52a Dave
20 * 1 10/07/98 10:49a Dave
22 * 17 5/06/98 5:30p John
23 * Removed unused cfilearchiver. Removed/replaced some unused/little used
24 * graphics functions, namely gradient_h and _v and pixel_sp. Put in new
25 * DirectX header files and libs that fixed the Direct3D alpha blending
28 * 16 3/10/98 4:18p John
29 * Cleaned up graphics lib. Took out most unused gr functions. Made D3D
30 * & Glide have popups and print screen. Took out all >8bpp software
31 * support. Made Fred zbuffer. Made zbuffer allocate dynamically to
32 * support Fred. Made zbuffering key off of functions rather than one
35 * 15 1/19/98 6:15p John
36 * Fixed all my Optimized Build compiler warnings
38 * 14 11/30/97 4:04p John
40 * 13 11/30/97 12:18p John
41 * added more 24 & 32-bpp primitives
43 * 12 10/19/97 12:55p John
44 * new code to lock / unlock surfaces for smooth directx integration.
46 * 11 10/14/97 4:50p John
49 * 10 10/14/97 8:08a John
50 * added a bunch more 16 bit support
52 * 9 10/09/97 5:23p John
53 * Added support for more 16-bpp functions
55 * 8 6/11/97 1:12p John
56 * Started fixing all the text colors in the game.
58 * 7 5/12/97 12:27p John
59 * Restructured Graphics Library to add support for multiple renderers.
61 * 6 12/12/96 4:59p Lawrance
62 * made clipping for horizontal and vertical gradient lines right
64 * 5 11/19/96 2:46p Allender
65 * fix up gradient support for 15bpp
67 * 4 11/18/96 4:34p Allender
68 * new 16 bit gradient functions
70 * 3 10/27/96 1:21a Lawrance
71 * added check to avoid divide by zero when calculating gradients
73 * 2 10/26/96 2:56p John
74 * Got gradient code working.
76 * 1 10/26/96 1:45p John
77 * Initial skeletion code.
88 #include "grinternal.h"
94 void gr8_gradient(int x1,int y1,int x2,int y2)
99 int clipped = 0, swapped=0;
104 if (!Current_alphacolor) {
105 gr_line( x1, y1, x2, y2 );
109 INT_CLIPLINE(x1,y1,x2,y2,gr_screen.clip_left,gr_screen.clip_top,gr_screen.clip_right,gr_screen.clip_bottom,return,clipped=1,swapped=1);
115 if ( dx==0 && dy==0 ) {
121 ubyte *dptr = GR_SCREEN_PTR(ubyte,x1,y1);
123 xlat_table = (ubyte *)&Current_alphacolor->table.lookup[0][0];
128 ystep=-gr_screen.rowsize / gr_screen.bytes_per_pixel;
130 ystep=gr_screen.rowsize / gr_screen.bytes_per_pixel;
151 *dptr = xlat_table[(l&0xF00)|*dptr];
161 *dptr = xlat_table[(l&0xF00)|*dptr];
174 *dptr = xlat_table[(l&0xF00)|*dptr];
184 *dptr = xlat_table[(l&0xF00)|*dptr];