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/TmapScanline.h $
15 * Header file for tmapscanline.cpp.
18 * Revision 1.2 2002/06/09 04:41:15 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 2 10/07/98 10:53a Dave
28 * 1 10/07/98 10:49a Dave
30 * 25 5/13/98 2:53p John
31 * Made subspace effect work under software. Had to add new inner loop to
32 * tmapper. Added glows to end of subspace effect. Made subspace effect
33 * levels use gamepalette-subspace palette.
35 * 24 4/10/98 5:20p John
36 * Changed RGB in lighting structure to be ubytes. Removed old
37 * not-necessary 24 bpp software stuff.
39 * 23 3/22/98 2:33p John
40 * Took out fx_v/v_right. Made fx_u etc get calculated in tmapper.
42 * 22 3/10/98 4:19p John
43 * Cleaned up graphics lib. Took out most unused gr functions. Made D3D
44 * & Glide have popups and print screen. Took out all >8bpp software
45 * support. Made Fred zbuffer. Made zbuffer allocate dynamically to
46 * support Fred. Made zbuffering key off of functions rather than one
49 * 21 12/15/97 11:32a John
52 * 20 12/02/97 4:00p John
53 * Added first rev of thruster glow, along with variable levels of
54 * translucency, which retquired some restructing of palman.
56 * 19 11/30/97 3:57p John
57 * Made fixed 32-bpp translucency. Made BmpMan always map translucent
58 * color into 255 even if you aren't supposed to remap and make it's
61 * 18 11/21/97 11:32a John
62 * Added nebulas. Fixed some warpout bugs.
64 * 17 10/16/97 10:55a John
65 * added tmapper to draw a monochrome alpha blended bitmap.
67 * 16 3/14/97 3:55p John
68 * Made tiled tmapper not always be zbuffered.
70 * 15 3/13/97 10:32a John
71 * Added code for tiled 256x256 textures in certain models.
73 * 14 3/05/97 7:15p John
74 * took out the old z stop tmapper used for briefing.
76 * 13 1/20/97 4:17p John
78 * 12 1/06/97 2:44p John
79 * Added in slow (but correct) zbuffering
81 * 11 12/10/96 10:37a John
82 * Restructured texture mapper to remove some overhead from each scanline
83 * setup. This gave about a 30% improvement drawing trans01.pof, which is
84 * a really complex model. In the process, I cleaned up the scanline
85 * functions and separated them into different modules for each pixel
88 * 10 11/26/96 6:50p John
89 * Added some more hicolor primitives. Made windowed mode run as current
90 * bpp, if bpp is 8,16,or 32.
92 * 9 11/07/96 6:19p John
93 * Added a bunch of 16bpp primitives so the game sort of runs in 16bpp
96 * 8 11/05/96 4:05p John
97 * Added roller. Added code to draw a distant planet. Made bm_load
98 * return -1 if invalid bitmap.
100 * 7 10/31/96 7:20p John
101 * Added per,tiled tmapper. Made models tile if they use 64x64 textures.
103 * 6 10/26/96 1:40p John
104 * Added some now primitives to the 2d library and
105 * cleaned up some old ones.
111 #ifndef _TMAPSCANLINE_H
112 #define _TMAPSCANLINE_H
115 typedef struct tmapper_vertex {
116 float sx, sy, sw, u, v, b;
119 typedef struct tmapper_data {
120 // These are filled once for each texture map being drawn.
121 // The inner loop cannot change any of these!!
122 int nv; // number of vertices
127 float FixedScale; // constant for asm inner loop
128 float FixedScale8; // constant for asm inner loop
129 float One; // constant for asm inner loop
131 // This are filled in by the outer loop before each scan line.
133 tmapper_vertex l, r, dl, dr, deltas;
135 float clipped_left; // how many pixels were clipped off the left in 2d.
137 // These are used internally by the assembly texture mapper.
138 fix fx_l, fx_l_right, fx_dl_dx;
139 fix fx_u, fx_v, fx_du_dx, fx_dv_dx;
153 uint DeltaUFrac, DeltaVFrac;
168 extern tmapper_data Tmap;
170 extern void tmapscan_generic();
171 extern void tmapscan_generic8();
172 //extern void tmapscan_pnn();
173 extern void tmapscan_pln();
174 extern void tmapscan_lln();
175 extern void tmapscan_flat();
176 extern void tmapscan_nebula8();
177 extern void tmapscan_flat_z();
179 extern void tmapscan_flat8();
180 extern void tmapscan_lln8();
181 extern void tmapscan_lnt8();
182 extern void tmapscan_lnn8();
183 extern void tmapscan_lnt8();
184 extern void tmapscan_lln8_tiled();
185 extern void tmapscan_llt8_tiled();
186 extern void tmapscan_pln8();
187 extern void tmapscan_plt8();
189 extern void tmapscan_lnaa8();
191 extern void tmapscan_pln8_tiled();
193 extern void tmapscan_lnn8_tiled_256x256();
194 extern void tmapscan_pnn8_tiled_256x256_subspace();
196 extern void tmapscan_flat_gouraud();
198 extern void tmapscan_nebula8();