2 * $Logfile: /Freespace2/code/Graphics/Line.cpp $
7 * Routines for drawing lines.
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 * 21 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 * 20 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 * 19 1/13/98 10:20a John
36 * Added code to support "glass" in alphacolors
38 * 18 11/30/97 12:18p John
39 * added more 24 & 32-bpp primitives
41 * 17 11/29/97 2:06p John
42 * added mode 16-bpp support
44 * 16 10/19/97 12:55p John
45 * new code to lock / unlock surfaces for smooth directx integration.
47 * 15 10/14/97 8:08a John
48 * added a bunch more 16 bit support
50 * 14 10/03/97 9:10a John
51 * added better antialiased line drawer
53 * 13 9/09/97 10:39a Sandeep
54 * Fixed compiler warnings level 4 (sorta, john is fixing most of it)
56 * 12 6/13/97 5:35p John
57 * added some antialiased bitmaps and lines
59 * 11 6/06/97 2:40p John
60 * Made all the radar dim in/out
62 * 10 5/12/97 12:27p John
63 * Restructured Graphics Library to add support for multiple renderers.
65 * 9 11/26/96 6:50p John
66 * Added some more hicolor primitives. Made windowed mode run as current
67 * bpp, if bpp is 8,16,or 32.
69 * 8 10/26/96 2:56p John
70 * Got gradient code working.
72 * 7 10/26/96 1:40p John
73 * Added some now primitives to the 2d library and
74 * cleaned up some old ones.
85 #include "grinternal.h"
91 void gr8_uline(int x1,int y1,int x2,int y2)
100 ubyte *dptr = GR_SCREEN_PTR(ubyte,x1,y1);
101 ubyte color = gr_screen.current_color.raw8;
105 ystep=-gr_screen.rowsize / gr_screen.bytes_per_pixel;
107 ystep=gr_screen.rowsize / gr_screen.bytes_per_pixel;
117 /* HARDWARE_ONLY - removed alpha color table stuff
118 if ( Current_alphacolor ) {
121 for(i=dx+1;i>0;i--) {
122 *dptr = Current_alphacolor->table.lookup[14][*dptr];
133 for(i=dy+1;i>0;i--) {
134 *dptr = Current_alphacolor->table.lookup[14][*dptr];
149 for(i=dx+1;i>0;i--) {
161 for(i=dy+1;i>0;i--) {
178 void gr8_line(int x1,int y1,int x2,int y2)
180 int clipped = 0, swapped=0;
182 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);
184 gr8_uline(x1,y1,x2,y2);