2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Graphics/Line.cpp $
15 * Routines for drawing lines.
18 * Revision 1.2 2002/06/09 04:41:18 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:09 root
25 * 3 12/02/98 5:47p Dave
26 * Put in interface xstr code. Converted barracks screen to new format.
28 * 2 10/07/98 10:53a Dave
31 * 1 10/07/98 10:49a Dave
33 * 21 5/06/98 5:30p John
34 * Removed unused cfilearchiver. Removed/replaced some unused/little used
35 * graphics functions, namely gradient_h and _v and pixel_sp. Put in new
36 * DirectX header files and libs that fixed the Direct3D alpha blending
39 * 20 3/10/98 4:18p John
40 * Cleaned up graphics lib. Took out most unused gr functions. Made D3D
41 * & Glide have popups and print screen. Took out all >8bpp software
42 * support. Made Fred zbuffer. Made zbuffer allocate dynamically to
43 * support Fred. Made zbuffering key off of functions rather than one
46 * 19 1/13/98 10:20a John
47 * Added code to support "glass" in alphacolors
49 * 18 11/30/97 12:18p John
50 * added more 24 & 32-bpp primitives
52 * 17 11/29/97 2:06p John
53 * added mode 16-bpp support
55 * 16 10/19/97 12:55p John
56 * new code to lock / unlock surfaces for smooth directx integration.
58 * 15 10/14/97 8:08a John
59 * added a bunch more 16 bit support
61 * 14 10/03/97 9:10a John
62 * added better antialiased line drawer
64 * 13 9/09/97 10:39a Sandeep
65 * Fixed compiler warnings level 4 (sorta, john is fixing most of it)
67 * 12 6/13/97 5:35p John
68 * added some antialiased bitmaps and lines
70 * 11 6/06/97 2:40p John
71 * Made all the radar dim in/out
73 * 10 5/12/97 12:27p John
74 * Restructured Graphics Library to add support for multiple renderers.
76 * 9 11/26/96 6:50p John
77 * Added some more hicolor primitives. Made windowed mode run as current
78 * bpp, if bpp is 8,16,or 32.
80 * 8 10/26/96 2:56p John
81 * Got gradient code working.
83 * 7 10/26/96 1:40p John
84 * Added some now primitives to the 2d library and
85 * cleaned up some old ones.
96 #include "grinternal.h"
102 void gr8_uline(int x1,int y1,int x2,int y2)
111 ubyte *dptr = GR_SCREEN_PTR(ubyte,x1,y1);
112 ubyte color = gr_screen.current_color.raw8;
116 ystep=-gr_screen.rowsize / gr_screen.bytes_per_pixel;
118 ystep=gr_screen.rowsize / gr_screen.bytes_per_pixel;
128 /* HARDWARE_ONLY - removed alpha color table stuff
129 if ( Current_alphacolor ) {
132 for(i=dx+1;i>0;i--) {
133 *dptr = Current_alphacolor->table.lookup[14][*dptr];
144 for(i=dy+1;i>0;i--) {
145 *dptr = Current_alphacolor->table.lookup[14][*dptr];
160 for(i=dx+1;i>0;i--) {
172 for(i=dy+1;i>0;i--) {
189 void gr8_line(int x1,int y1,int x2,int y2)
191 int clipped = 0, swapped=0;
193 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);
195 gr8_uline(x1,y1,x2,y2);